Dear All,
Day by day when we are working with SAS, coming to know so many Automatic Variables. I just want to know whether we can find list of all Automatic variables available in SAS ? If anyone is having URL, that will be really helpful before you want to use any of the Automatic variables (Except Macro Automatic variables).
Thanks a lot in advance for help.
Regards,
S Ravuri.
Thanks for quick response Ballardw.
I got some of Automatic Variables info and am just sharing for the same.
_ALL_ Lists the values of all macro variables.specifies all variables that are currently defined in the current DATA step.
_AUTOMATIC_ Lists the values of all automatic macro variables
_USER_ Lists the values of all user-defined macro variables
_NUMERIC_
specifies all numeric variables that are already defined in the current DATA step.
_CHARACTER_
specifies all character variables that are currently defined in the current DATA step.
Regards,
S Ravuri.
Since different modules and operating systems have different automatic variables I would recomend starting by searching in your SAS online help for "automatic". I have lists for automatic macro variables, error, VSAM processing and SAS/IntrNet to name just a few places.
A single list probably wouldn't make sense as you may not be able to use all of them without the appropriate modules.
Thanks for quick response Ballardw.
I got some of Automatic Variables info and am just sharing for the same.
_ALL_ Lists the values of all macro variables.specifies all variables that are currently defined in the current DATA step.
_AUTOMATIC_ Lists the values of all automatic macro variables
_USER_ Lists the values of all user-defined macro variables
_NUMERIC_
specifies all numeric variables that are already defined in the current DATA step.
_CHARACTER_
specifies all character variables that are currently defined in the current DATA step.
Regards,
S Ravuri.
Some clarification ...
Macro variables and SAS data variables are altogether different things.
Examples of automatic variables: _N_ and _ERROR_ in the DATA step, _TYPE_ and _FREQ_ in PROC SUMMARY/MEANS.
The items which S. listed are not automatic variables. Rather, they are shorthand notations which expand to be lists of zero or more variables (which are generally not automatic variables).
In fact, _NUMERIC_ excludes automatic variables when it is expanded.
sambasiva.ravuri@tcs.com wrote:Thanks for quick response Ballardw.
I got some of Automatic Variables info and am just sharing for the same.
_ALL_ Lists the values of all macro variables.specifies all variables that are currently defined in the current DATA step.
_AUTOMATIC_ Lists the values of all automatic macro variables
_USER_ Lists the values of all user-defined macro variables
_NUMERIC_
specifies all numeric variables that are already defined in the current DATA step.
_CHARACTER_
specifies all character variables that are currently defined in the current DATA step.Regards,
S Ravuri.
Also,
You can see all available automatic variables using the command in given link:-
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206943.htm
%put _ALL_ ;
Thanks a lot for sharing nice URL.
Regards,
S Ravuri.
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.