08-18-2015 08:11 AM
Dear SAS Folks, The following part of my existing Retail Datawarehouse SAS script in production throws an error/warning when executed as mentioned below:
WARNING: An argument to the function SYSGET referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.
The system runs on Unix environment where basically a shell script executes the underlying SAS scripts. I am finding it dificult to understand the concept of operating variable as I read through the documentation for sysget function.
In the above link, i noticed this point-"If the value of the operating environment variable is truncated or the variable is not defined in the operating environment, SYSGET displays a warning message in the SAS log."
Please kindly advice a fix to my problem.
08-18-2015 08:27 AM
Use the built in macro function %SYSGET() instead of trying use %SYSFUNC() to call the data step function SYSGET().
You could also try using a PIPE to read the output of an echo command, but that would not be operating system independent and requires that PIPE engine access is allowed.
infile 'echo $STORE_ID' pipe;
Remember that on Unix environment variable names are case sensitive so STORE_ID is a different variable than store_id.