I have this but i cannot put the ending bracket.
Can you please advise.
Thank You
options symbolgen mprint mlogic merror;
filename code temp;
data _null_;
file code ;
set sashelp.class(obs=10);
if _n_=1 then put "select name from sashelp.class where name in (" @;
else put ',' @;
str = quote(strip(name),"'");
put str ;
if eof then put ");quit;";
run;
%macro tst_code;
proc sql;
%include code ;
%mend tst_code;
%tst_code;
You didn't provide a variable EOF that should indicate the end of the file.
set sashelp.class(obs=10) end=eof;
The End= assigns end of data to the variable name following the =;
Without it your code 1) created a variable named EOF
2) with a missing value
and missing is never true so that put never occurred.
You didn't provide a variable EOF that should indicate the end of the file.
set sashelp.class(obs=10) end=eof;
The End= assigns end of data to the variable name following the =;
Without it your code 1) created a variable named EOF
2) with a missing value
and missing is never true so that put never occurred.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.