BookmarkSubscribeRSS Feed
nimmy_mj
Calcite | Level 5

X command is not working in SAS EG client while submitting via individual user profile, but the same command is working from sas user while submitting via EG.

 

x command:

x  'source /home/sas/.bashrc; python /share/sasdata/export_file.py';

 

The above .bashrc file installize anaconda environment

 

Also, I saved the x command to a .sas file and tried to run it on SAS Compute server (Linux server) using below in-line command:-

{SASCompute}/Lev1/SASApp/sas.sh Python_sas.sas

I was able to execute the command successfully using individual user.

I am confused as to how the same command could be executed from sas user, but fails to generate output if submitted via individual user through EG, provided the individual user is able to launch sas.sh from Compute server.

 

Note: There are no error in logs generated for x command execution

2 REPLIES 2
r_behata
Barite | Level 11

X COMMAND May Need to be Enabled on the WorkSpace Server , refer to the link for more info.

 

https://blogs.sas.com/content/sasdummy/2009/11/19/using-the-x-and-systask-commands-from-sas-enterpri...

Kurt_Bremser
Super User

After executing the X statement, check the automatic macro variable &sysrc. It holds the return code of the external command.

Your users woll have different environments, be it permissions or current working directories. Call python with the full absolute path.

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!

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