BookmarkSubscribeRSS Feed
ucvikas
Obsidian | Level 7

Dear SAS Experts,

Can you explain me or give pointers for below questions ? I am using sas 9.4 on linux machine

1. how sas knows which config files to use for execution of a sas code ? if I execute below code from command line then I see sas is using combination of 3 config files . which place in the system we instruct sas to use these combination?

 

proc options option=config;
run;

log file 

------------------------------

CONFIG=( /sas/software/SASInstallFolder/SASFoundation/9.4/sasv9.cfg
/sas/software/SASInstallFolder/SASFoundation/9.4/nls/en/sasv9.cfg /sas/software/SASInstallFolder/SASFoundation/9.4/sasv9_local.cfg )
Specifies the configuration file that is used when initializing or overriding the values of SAS system options.
NOTE: PROCEDURE OPTIONS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

-------------------------------------

 

2. I have to override certain options ( say memsize) by using extra config file ( say extra.cfg) . how to instruct sas to use extra config by keeping all other options same . how to form command which uses four or more config file?

something like this 

 /sas/software/SASHome/SASFoundation/9.4/sas -sysin test.sas -log test.log -config <using combination of four config file>

9 REPLIES 9
Kurt_Bremser
Super User

These are the default configuration files SAS uses when run without a specific -config option on the commandline. They reside in the SAS installation path, which is different from the configuration path that a complete BI server installation uses.

If you want to add customization, do this in

/sas/software/SASInstallFolder/SASFoundation/9.4/sasv9_local.cfg

This file will not be overwritten by hotfixes

 

If you intend to set up a customized environment for (eg) batch runs by your scheduling software, I'd recommend using the -config and -autoexec options on the commandline to specify custom configuration files. This will completely override the default configuration.

ucvikas
Obsidian | Level 7

I tried like below and got error.

 

/sas/software/SASHome/SASFoundation/9.4/sas -sysin test.sas -log test.log -config extra.cfg

---------------------------------------------------------------------

content of file extra.cfg is like below . only one  option

 

-memsize 30720m

--------------------------------------------------------------------

ERROR: A Configuration Error has been detected.
There are no paths specified to locate executables.
SAS Initialization has failed.
Check your config file for a missing -path option.

 

I have the impression that sas expects someting from all three default config files. 

 

I just want to overide default options by the options I specify in extra.cfg file, rest should be intact. I want to use config file way of working as it will  give me flexibility to change things for many programs at one place.

Kurt_Bremser
Super User

When using a single customized config file (instead of putting the customization in one of the files designed for that, like the one that I named in my previous post), it is best to copy the contents of the files that were used by default (see your inital post), assemble them into a single file, and then make your changes there. That way you preserve all the config options that SAS needs to work at all, like the -path which is probably the source of your problem.

 

ucvikas
Obsidian | Level 7

that works . thanks.

If I append all four cfg files and make one file out of that then I will have to make changes at two places if at all I need to modify any of four files. Is there any way I can specify four config files in command line without making one file out of four ?

 

someting like

 

 /sas/software/SASHome/SASFoundation/9.4/sas -sysin test.sas -log test.log -config (/sas/software/SASInstallFolder/SASFoundation/9.4/sasv9.cfg /sas/software/SASInstallFolder/SASFoundation/9.4/nls/en/sasv9.cfg  /sas/software/SASInstallFolder/SASFoundation/9.4/sasv9_local.cfg /sas/software/SASConfigFolder/Lev1/SASApp/WorkspaceServer/sasv9_usermods.cfg)

 

 

Kurt_Bremser
Super User

You can put a list into the environment variable SASCFGPATH.

example from WorkspaceServer.sh:

SASCFGPATH="$APPSERVER_ROOT/sasv9.cfg,  APPSERVER_ROOT/sasv9_usermods.cfg, $CONFIGDIR/sasv9.cfg, CONFIGDIR/sasv9_usermods.cfg"
export SASCFGPATH

SAS will then use that list, if you call it without the -config option.

Another possibility for you would be to have a sasv9.cfg file in the directory from where you call SAS, and put only the options you need into it. If you simply call SAS without the -config option, this will be the last config file processed automatically, and its settings will override the SAS defaults where possible.

avellani
Fluorite | Level 6

Thank you for always sharing.
SASKiwi
PROC Star

Here is a useful link to help understand how SAS config files work:

 

https://support.sas.com/documentation/cdl/en/bisag/68240/HTML/default/viewer.htm#p1n3ivrea2b8fgn1at5...

 

In your case just focus on the Application server configs and follow the recommendations discussed.

ucvikas
Obsidian | Level 7

thanks for the link.

I want to use options of file

 

/sas/software/SASConfigFolder/Lev1/SASApp/sasv9_usermods.cfg in addition to the default config file which is used in batch mode

where options in sasv9_usermods.cfg override the defaults. if some option is not present in sasv9_usermods.cfg then it should take it from default.

Patrick
Opal | Level 21

I tend to use sasbatch.sh for such tasks because that is what scheduled jobs normally use. In doing so I'm running my command line jobs for unit testing with the same options as they will get when run via scheduler.

/sso/biconfig/940/Lev1/SASApp/BatchServer/sasbatch.sh -log /sso/biconfig/940/Lev1/Logs/myprog_  -batch -noterminal -logparm "rollover=session"  -sysin /sso/biconfig/940/Lev1/SASApp/SASEnvironment/SASCode/Jobs/myprog.sas

If there are already scheduled jobs then I normally "steal" the batch command from there and then amend it to my needs.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 3736 views
  • 4 likes
  • 5 in conversation