BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mikepark
Obsidian | Level 7

I know that automatic variables are dropped at the end of the data step. Is there a way to see it though? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
data _null_;
 set sashelp.class;
 put _all_;
run;

View solution in original post

5 REPLIES 5
novinosrin
Tourmaline | Level 20

Write to the log using put/putlog or assign the value to a new variable

Astounding
PROC Star

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.

ghosh
Barite | Level 11
* From  a blog by Rick Wicklin ; 
%put _AUTOMATIC_;
%put _USER_;
gamotte
Rhodochrosite | Level 12
Not that "%put _AUTOMATIC_;" gives the values of automatic *macro* variables.

You can use
put _ALL_;
to print the values of all variables, including automatic variables, available in your data step.
Ksharp
Super User
data _null_;
 set sashelp.class;
 put _all_;
run;

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1167 views
  • 5 likes
  • 6 in conversation