BookmarkSubscribeRSS Feed
woo
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

Hello - when we use sasgsub command to run job in batch mode (sas test.sas) and when have x cmd to output results in form of .lst or whatever, its not running - just doing nothing. this is happening with new environment (sas 9.4 grid/Linux). example,

 

x env | sort > /userhome-dir/test.lst;

 

where to look to allow xcmd command?

 

 

 

5 REPLIES 5
foobarbaz
Obsidian | Level 7

Hi,

Allow XCMD must be enabled.  You can do this either in Management Console in options for the various sas servers or set -XCMD in your sasv9.cfg usermods file.

 

 

Regards,
Cameron | Selerity
woo
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

on old environment we have -xcmd mentioned in sasbatch.sh - its working fine (we didn't mentioned -xcmd in sasv9.conf). however, in new environment we are going to use sasgsub so i am not sure where it needs to be. 

nhvdwalt
Barite | Level 11

Run the below in your batch job. This will tell you if X commands are enabled for that particular SAS session.

 

proc options option=xcmd;
run;
woo
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

it says,

 

XCMD              Enables the X command in SAS.

 

I believe when we use sasgsub -gridsubmitpgm command to run sas job, x command interpret differently.

 

I was trying running it with systask but no luck.

 

systask command "mkdir /user-home-dir/test";

nhvdwalt
Barite | Level 11

XCMD is a Base SAS thing, not a SASGSUB thing, so regardless of how you invoke SAS, if the SAS session is XCMD enabled, like you have verified, then you should be good.

 

Just humor me and put your OS command in quotes, like below:

 

x 'env | sort > /userhome-dir/test.lst';

Also, have you tried running this command on the UNIX command line with the same user that runs the SAS job ?

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1678 views
  • 1 like
  • 3 in conversation