Architecting, installing and maintaining your SAS environment

XCMD command for SAS/Connect

Occasional Contributor
Posts: 5

XCMD command for SAS/Connect

[ Edited ]

Hi All,


I am running below code but it fails with message “ERROR: Shell escape is not valid in this SAS session”.  This code basically via SAS/Connect connects to remote host and run X command.


When I run the same command via workspace Server(i.e. via SAS EG on local host) the code works. What I understood is it is becasue Connect Server starts with -NOXCMD option. 


I tried to make change from -NOXCMD to XCMD, by making changes in  sasv9_usermods.cfg and but nothing works.


Please suggest. 

PS: XCMD is working fine for workspace server in remote and local, also permission of file is correct. And Connect Server is working fine as TCP connection is happening.


--> Code:

LIBNAME ADM00 BASE "Data/ETLA-System_Administrasjon/ADM.00_Common";


%LET TCPHOST = dc4coj  7552;
options remote=TCPHOST comamid=tcp;

signon TCPHOST user=sasftp pass="XXXX";

rsubmit TCPHOST;


data _null_;
command="df -g >/drift/logs/admin/ADM_DF_Disk_Usage_dc4coj.txt";
call system(command);





--> Startup Script for Connect Server:

/local/apps/SAS94/config/Lev1/SASETL/ConnectServer/ -DMR -COMAMID TCP -NOXCMD -NOTERMINAL


--> Changes in sasv9_usermods.cfg and

$  cat

#!/bin/sh -p




# This script extends  Add local environment variables

# to this file so they will be preserved.






$ cat sasv9_usermods.cfg





Super User
Posts: 7,796

Re: XCMD command for SAS/Connect

Posted in reply to Nishant2000

Take a look at the connect spawner configuration in SAS metadata.

Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 5

Re: XCMD command for SAS/Connect

Posted in reply to KurtBremser



 I checked in Meta environment there is no configuration for connect spawner, and as connect server is in compute layer the configuration looks to be fine. 


What exactly I need to check in metadata?

Occasional Contributor
Posts: 12

Re: XCMD command for SAS/Connect

Posted in reply to Nishant2000

Please try updating file in your compute tier. Add the following:



Restart Connect spwner and test.




Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation