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);
Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

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);
Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 970 views
  • 3 likes
  • 4 in conversation