Architecting, installing and maintaining your SAS environment

How to use more than one config file in linux sas

Reply
Contributor
Posts: 56

How to use more than one config file in linux sas

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>

Super User
Posts: 6,939

Re: How to use more than one config file in linux sas

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 56

Re: How to use more than one config file in linux sas

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.

Super User
Posts: 6,939

Re: How to use more than one config file in linux sas

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.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 56

Re: How to use more than one config file in linux sas

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)

 

 

Super User
Posts: 6,939

Re: How to use more than one config file in linux sas

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 3,108

Re: How to use more than one config file in linux sas

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.

Contributor
Posts: 56

Re: How to use more than one config file in linux sas

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.

Ask a Question
Discussion stats
  • 7 replies
  • 549 views
  • 3 likes
  • 3 in conversation