BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
tborange
Fluorite | Level 6

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?

tborange_0-1664473102386.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

The %SYSGET macro function can retrieve the value of system environment variables.

 

%let val = %sysget(TEST);
Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

View solution in original post

4 REPLIES 4
ChrisHemedinger
Community Manager

The %SYSGET macro function can retrieve the value of system environment variables.

 

%let val = %sysget(TEST);
Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
tborange
Fluorite | Level 6

Chris,

Thank you. That worked like a charm.

I was using an incorrect method (%sysfunc(getoption(TEST)))

 

Regards,

Troy

ballardw
Super User

@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-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1174 views
  • 3 likes
  • 4 in conversation