I'm trying to capture Environment Variables that are defined in a SMC Flow
Below is a screen shot of a SMC Flow that I manually set the Environment Variable "TEST" to 123.
This Flow calls a SAS Program via an SMC Deployed Job.
Question: Is it possible for the SAS program to capture \ parse this environment variable?
The %SYSGET macro function can retrieve the value of system environment variables.
%let val = %sysget(TEST);
The %SYSGET macro function can retrieve the value of system environment variables.
%let val = %sysget(TEST);
Chris,
Thank you. That worked like a charm.
I was using an incorrect method (%sysfunc(getoption(TEST)))
Regards,
Troy
@tborange wrote:
Chris,
Thank you. That worked like a charm.
I was using an incorrect method (%sysfunc(getoption(TEST)))
Regards,
Troy
The GETOPTION function only can get SAS system or graphics options such as are set with the OPTIONS or GOPTIONS statements. While the value of an environment variable might be able to set the value of an option you would have to query the for the Option that was set to see the value with Getoption.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.