Hello all,
How to check what is the AUTOEXEC defination for the current SAS?
Also how to check initial of the SAS session?
Thanks!
You might start with:
%put %sysfunc(getoption(autoexec));
If that returns autoexec.sas, you might still need to look around to find which autoexec.sas file was read (there are rules for where SAS searches).
What do you mean by "check initial of the SAS session"? Do you mean version?
%put &sysvlong;
This will give you the location of the autoexec file for the current session
proc options option=autoexec;
run;
You can then read this in any text editor.
As for the second part of your question - the initial what?
You might start with:
%put %sysfunc(getoption(autoexec));
If that returns autoexec.sas, you might still need to look around to find which autoexec.sas file was read (there are rules for where SAS searches).
What do you mean by "check initial of the SAS session"? Do you mean version?
%put &sysvlong;
Have a look at the GETOPTION function, it can return different information like:
returns the default option value.
Restriction | DEFAULTVALUE is valid only for SAS system options. SAS issues a warning message when the DEFAULTVALUE option is specified and option-name is a graphics option. |
returns a character string that specifies the scope of an option.
Restriction | HOWSCOPE is valid only for SAS system options. SAS issues a warning message when the HOWSCOPE option is specified and option-name is a graphics option. |
returns a character string that specifies how an option value was set.
Restriction | HOWSET is valid only for SAS system options. SAS issues a warning message when the HOWSET option is specified and option-name is a graphics option. |
returns the system option value that was used to start SAS either on the command line or in a configuration file.
Restriction | STARTUPVALUE is valid only for SAS system options. SAS issues a warning message when the STARTUPVALUE option is specified and option-name is a graphics option. |
the option echoauto shows the statements in the autoexec.sas program
otherwise all you get is this message:
NOTE: AUTOEXEC processing beginning; file is C:\temp\sas-c-temp\autoexec.sas.
Here is my setup for Windows DOS batch programs.
*name: autoexec.sas;
title1 'My Project';
filename project '.';*here;
libname library '..\sas7b';
options linesize=max pagesize=max;
Here is a paper with the list of global statements to hide in the autoexec:
An Autoexec Companion, Allocating Location Names during Startup
next: a program which does next to nothing;
*name: autoexec-test.sas;
filename project list;*unlike libname which does list when allocated;
%put _global_;
the option echoauto works like source2 on an %include:
%include 'autoexec.sas'/source2;
rem name: autoexec-test.bat
sas autoexec-test -echoauto
hth
Ron Fehd formerly (MVS or z/OS), now Batch_processing_under_Windows maven
Hello Ron,
May I ask you submit SAS batch job in PC or windows server?
Thanks!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.