Desktop productivity for business analysts and programmers

Transfer an environnement variable unix into sas macro variable

Reply
Occasional Contributor
Posts: 8

Transfer an environnement variable unix into sas macro variable

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 ! 

 

Super User
Posts: 19,063

Re: Transfer an environnement variable unix into sas macro variable

Are the variables case sensitive?

PROC Star
Posts: 1,146

Re: Transfer an environnement variable unix into sas macro variable

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

Super User
Super User
Posts: 6,842

Re: Transfer an environnement variable unix into sas macro variable

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;
Ask a Question
Discussion stats
  • 3 replies
  • 153 views
  • 0 likes
  • 4 in conversation