2 select distinct style, sqfeet
3 into :s1, :s2 TRIMMED
4 from proclib.houses;
5 %put &s1 &s2;
CONDO 900
6 %put There were &sqlobs distinct values.;
There were 1 distinct values.
• You can create one new macro variable per row in the result of the SELECT
statement. This example shows how you can request more values for one column
than for another. The hyphen is used in the INTO clause to imply a range of macro
variables. You can use either of the keywords THROUGH or THRU instead of a
hyphen.
The following PROC SQL step puts the values from the first four rows of the
Proclib.HOUSES table into macro variables:
proc sql noprint;
select distinct Style, SqFeet
into :style1 - :style3, :sqfeet1 - :sqfeet4
from proclib.houses;
%put &style1 &sqfeet1;
%put &style2 ...