in a sasv9.cfg file in "my documents\" I can provide sas system options that are my personal preference. Automatically this config file will be used when I invoke sas.exe without specifying any -config parameter.
I a config file SAS uses !prefix to indicate an environment variable, so
-WORK "!TEMP\SAS Temporary Files"
says assign system option WORK the path where-ever system environment variable TEMP points and under that in folder "SAS Temporary Files".
There are many of these environment variables used.
I would like to use an environment variable to name a file but behaviour is odd.
uses the value in environment var PROG as the value for that system option, but
create an altlog file named !PROG.log and does not substitute the value of the environment variable.
Is there a special symbol (like . following macro variable names) which does the job for environment variable reference in configuration files?
A "\" works and treats the environment variable as the name of a folder, but that is not what i want for the filename for the altlog.
thank you for the complement (appreciate it very much from you!)
Tried %sysget, but the resulting value is only the request for the env-var, not the value itself. Here are some notes pushed to SASlog to check on the situation [pre]
NOTE: local config file
C:\Users\Peter Crawford\Documents\my sas files\sasv9.cfg
1 -set PROG demo.e-Vars
2 -awstitle %sysget(PROG)
3 -altlog %sysget(prog).log
environment variable PROG is demo.e-Vars
AWStitle has value %sysget(PROG)
altlog value is
C:\Users\Peter Crawford\Documents\my sas files\%sysget(prog).log[/pre]these messages were generated by this data step in autexec.sas
data _null_ ;
* collect and report testing of start-up parameters ;
length altlogv Var1-Var5 $1000 ;
altlogv = getoption( 'altlog' ) ;
Var1 = "%sysget( PROG )" ;
var2 = getoption( 'config' ) ;
var5 = getoption( 'awstitle' ) ;
put 'NOTE: ' ;
put 'NOTE: local config file ' @ ;
infile 'sasv9.cfg' filename= var3 end=eof ;
input @ ;
put var3 / @7 'contains';
do ROW=1 by 1 while( not eof );
var4 = _infile_ ;
PUT 'NOTE- ' row var4 ;
put 'NOTE- ';
option ls=70 ;
putLog 'NOTE- environment variable PROG is ' Var1 ;
putLog 'NOTE- AWStitle has value ' Var5 ;
putLog 'NOTE- altlog value is ' altLogV ;
putlog 'NOTE- config files used ' var2 ;
put 'NOTE- ';
put 'NOTE: ---------------------------------------------------' ;
looks like I can only let an environment var be followed by a \
I hoped/wanted the env-var to work like a macro var, but it isn't achieving that.