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.
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
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;
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 .
@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?
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
could you please tell me where to find the autoexec_usermods.sh files ?
i will be so grateful
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.