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>
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/s
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.
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.
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.
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)
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.
Here is a useful link to help understand how SAS config files work:
In your case just focus on the Application server configs and follow the recommendations discussed.
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.
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.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.