DATA Step, Macro, Functions and more

show AUTOEXEC and initial value

Accepted Solution Solved
Reply
Regular Contributor
Posts: 241
Accepted Solution

show AUTOEXEC and initial value

Hello all,

 

 

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

 

Also how to check initial of the SAS session?

 

Thanks!


Accepted Solutions
Solution
‎09-14-2017 04:25 PM
PROC Star
Posts: 1,324

Re: show AUTOEXEC and initial value

Posted in reply to GeorgeSAS

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;

View solution in original post


All Replies
Super User
Posts: 19,861

Re: show AUTOEXEC and initial value

Posted in reply to GeorgeSAS
Super Contributor
Posts: 441

Re: show AUTOEXEC and initial value

Posted in reply to GeorgeSAS

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?

Solution
‎09-14-2017 04:25 PM
PROC Star
Posts: 1,324

Re: show AUTOEXEC and initial value

Posted in reply to GeorgeSAS

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;
SAS Super FREQ
Posts: 709

Re: show AUTOEXEC and initial value

Posted in reply to GeorgeSAS

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.

 

Regular Contributor
Posts: 227

Re: show AUTOEXEC and initial value

Posted in reply to GeorgeSAS

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

 

Regular Contributor
Posts: 241

Re: show AUTOEXEC and initial value

Posted in reply to Ron_Fehd_macro_maven

Hello Ron,

 

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

 

Thanks!

Regular Contributor
Posts: 227

Re: show AUTOEXEC and initial value

Posted in reply to GeorgeSAS
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
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 218 views
  • 5 likes
  • 6 in conversation