BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
aloou
Obsidian | Level 7

Hello everyone , please help me to resolve this :

%let env-type=%sysget(ENV_TYPE)

knowing that ENV_TYPE is a variable in UNIX , i did echo $ENV_TYPE and i got "Dev"

now by doing this : %let env-type=%sysget(ENV_TYPE)

%put &env_type; 

i receive no answer.

 

Could you please lead me in this.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

There you have it. ENV_TYPE is not defined in the context of the workspace server.

 

Workspace servers do not execute your .profile etc. If you need specific environment variables, you have to set them in the relevant WorkspaceServer_usermods.sh files.

 

Edit: corrected autoexec_usermods.sh to WorkspaceServer_usermods.sh

View solution in original post

7 REPLIES 7
Kurt_Bremser
Super User

How did you echo the %SYS_ENV? Mind that logging on to the commandline will give you a different environment that what you have underneath the SAS workspace server.

Please post the log of

%let env_type=%sysget(ENV_TYPE);
%put &env_type; 

This is what I get because SYS_ENV is not defined on our server:

WARNING: The argument to macro function %SYSGET is not defined as a system variable.
24         %let env_type=%sysget(ENV_TYPE);
25         %put &env_type;
aloou
Obsidian | Level 7

Under UNIX i did echo $ENV_TYPE and i got "Dev" , meaning that if i that i type on SAS EG :

%let env_type=%sysget(ENV_TYPE);
%put &env_type;

"Dev" shall be assigned to &env_type .

 

 

Kurt_Bremser
Super User

@aloou wrote:

Under UNIX i did echo $ENV_TYPE and i got "Dev" , meaning that if i that i type on SAS EG :

%let env_type=%sysget(ENV_TYPE);
%put &env_type;

"Dev" shall be assigned to &env_type .

 

 


Log?

aloou
Obsidian | Level 7

log EG.PNG

Kurt_Bremser
Super User

There you have it. ENV_TYPE is not defined in the context of the workspace server.

 

Workspace servers do not execute your .profile etc. If you need specific environment variables, you have to set them in the relevant WorkspaceServer_usermods.sh files.

 

Edit: corrected autoexec_usermods.sh to WorkspaceServer_usermods.sh

aloou
Obsidian | Level 7

could you please tell me where to find the autoexec_usermods.sh files ?

i will be so grateful 

Kurt_Bremser
Super User

Look at

sasconf/Lev1/server/WorkspaceServer/WorkspaceServer_usermods.sh

where sasconf is the root location of your SAS configuration tree, and server is your application server context (most probably SASApp).

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 4116 views
  • 0 likes
  • 2 in conversation