BookmarkSubscribeRSS Feed
Asmam
Fluorite | Level 6

Hi everyone,

 I create a global environnement variable unix (env), I want to transfer this variable to a macro variable sas, i used this command 

 

%let person=%sysget(env);
%put &person;

 

the macro variable person is empty, when I put the environnement variable unix HOME instead of env, it's working ! 

help me please ! 

 

3 REPLIES 3
Reeza
Super User

Are the variables case sensitive?

TomKari
Onyx | Level 15

If you're using EG on windows with a Unix SAS server, the SAS environment is spinning up a workspace server session for your EG session.

 

I can't think offhand how you could populate an environment variable in that workspace session. Could you perhaps have SAS read the value from a file instead?

 

Tom

Tom
Super User Tom
Super User

How are you getting this environment variable created? It would need to be in the unix shell that is launching the SAS workspace server that EG is connecting to in order to be visible to your SAS session.

 

If you can use PIPE then you can have SAS ask Unix what environment variables exist.

 

data _null_;
  infile 'env' pipe;
  input;
  put _infile_;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 952 views
  • 0 likes
  • 4 in conversation