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

Hello all,

 

 

How to check what is the AUTOEXEC defination for the current SAS?

 

Also how to check initial of the SAS session?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

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;
BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

View solution in original post

7 REPLIES 7
ChrisBrooks
Ammonite | Level 13

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?

Quentin
Super User

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;
BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
BrunoMueller
SAS Super FREQ

Have a look at the GETOPTION function, it can return different information like:

Return Value Options

DEFAULTVALUE

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.

HOWSCOPE

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.

HOWSET

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.

STARTUPVALUE

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.

 

Ron_MacroMaven
Lapis Lazuli | Level 10

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

 

GeorgeSAS
Lapis Lazuli | Level 10

Hello Ron,

 

May I ask you submit SAS batch job in PC or windows server?

 

Thanks!

Ron_MacroMaven
Lapis Lazuli | Level 10
my programs and data were on a server

I had PC-SAS on each of the computers that I used to access those programs.

I neglected to show my file sas.cmd

rem: sas.cmd
call "C:\...\SASFoundation\9.4\sas.exe" %*

where %* is the DOS command for "pass all command-line options"

you may need sasv9.cfg

hth
Ron

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 7 replies
  • 2305 views
  • 5 likes
  • 6 in conversation