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);
SAS Innovate 2025: Call for Content! Submit your proposals before Sept 16. Accepted presenters get amazing perks to attend the conference!

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);
SAS Innovate 2025: Call for Content! Submit your proposals before Sept 16. Accepted presenters get amazing perks to attend the conference!
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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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