It IS showing, see this log of your code:
24 %let count=6; 25 Proc SQL Noprint; 26 Select distinct (age) into:A1-:A%left(&count) from sashelp.class; 27 Quit; NOTE: PROZEDUR SQL used (Total process time): real time 0.01 seconds cpu time 0.00 seconds 28 %put &A1 &&A&count; 11 16
@thanikondharish wrote:
Sorry previous something happened
Then show the entire log of what happens when you run your code.
I believe that we have asked for your do provide LOG results in the past. Again,
The INTO clause only creates the macro variables that it needs. So if the query result had less than 6 observations then less than 6 macro variables will be written.
Why are you setting COUNT before you run the query? Why do you have the %LEFT() call? Does you value of COUNT have leading spaces? Why did you put leading spaces into the macro variable COUNT? Also why are you only calling %LEFT() in one of the two places you use count?
SAS can count for you. No need to count in advance or set an upper limit on the number of macro variables to create.
proc sql noprint;
select distinct (age) into :A1- from sashelp.class;
%let count=&sqlobs;
quit;
%put &=count &A1 &&A&count;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.