In the previous chapter, we spoke about learning about the essentials of Proc SQL before turning our attention to Macros. Let's explore this aspect in Proc SQL since some of the functionalities of macros take longer to code using the DATA step.
Macros in Proc SQL are powerful, primarily due to the INTO clause that is offered in conjunction with the SELECT statement. The INTO clause cannot be used while creating tables or views. The INTO clause for the SELECT statement can assign the result of a calculation or the value of a data column (variable) to a macro variable. If the macro variable doesn't exist, INTO creates it. You can use PROC SQL's SQLOBS macro variable to see how many rows (observations) were produced by a SELECT statement. Let's explore this clause using a few examples.