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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
sambasiva_ravuri_tcs_com
Calcite | Level 5

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.

View solution in original post

5 REPLIES 5
ballardw
Super User

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.

sambasiva_ravuri_tcs_com
Calcite | Level 5

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.

Howles
Quartz | Level 8

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.

manojinpec
Obsidian | Level 7

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

sambasiva_ravuri_tcs_com
Calcite | Level 5

Thanks a lot for sharing nice URL.

Regards,

S Ravuri.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1641 views
  • 0 likes
  • 4 in conversation