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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.