I know that automatic variables are dropped at the end of the data step. Is there a way to see it though? Thanks!
data _null_;
set sashelp.class;
put _all_;
run;
Write to the log using put/putlog or assign the value to a new variable
A few ways.
You can add a PUT statement within the DATA step:
put first.state;
Or you can copy the variable to a different DATA step variable:
auto1 = first.state;
auto2 = last.state;
auto3 = eof;
auto4 = _n_;
Then you will have this new set of variables available in the output data set.
If you ask a more specific questions, you can get a more specific answer.
* From a blog by Rick Wicklin ;
%put _AUTOMATIC_;
%put _USER_;
data _null_;
set sashelp.class;
put _all_;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.