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;
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.