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

Hi, 

 

I am currently creating a process which will be scheduled on our Viya 3.3 environment which will effectively loop through a folder and read filenames of a certain pattern. 

 

So obviously to start I need a list of files. 

 

This would be completed using something similar to the below

 

filename myfiles pipe "ls /data/files/*.ext";

And stored in a table using a subsequent data step. I first got errors then surrounding XCMD issues, so obviously this option is disabled by default. Similar messages occur using the %SYSEXEC Macros.

 

ERROR: Shell Escape is Not Valid in this Session

I've tried adding the 

 

OPTIONS XCMD;

 

to the start of the script which appears to not have worked, and I do have access to autoexec_usermods.sas and have added the same still no luck. 

 

Finally I've tried implementing the Enabling -XCMD for the SAS Connect Spawner and still no luck.

 

I get the security implications for disabling this initially, however it surely isn't that hard to enable system commands in SAS? If anybody can point me in the right direction, it would be greatly appreciated.  

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
daithi1990
Obsidian | Level 7

I actually got it on Viya 3.3, if you go to 

 

vi /opt/sas/spre/config/etc/spawner/default/spawner_usermods.sh

 

&

 

vi /opt/sas/viya/config/etc/spawner/default/spawner_usermods.sh

 

Then add the following statement

 

USERMODS="$JREOPTIONS -allowxcmd"

 

Then restart the sas-viya-spawner-default service, you should be able to run system commands in procedures in Viya

 

 

 

 

 

 

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

After making changes to a workspace server configuration, you need to restart the Object Spawner for that physical machine.

In SMC, navigate to the Workspace Server, open Properties - Options - Advanced, and in the tab for startup properties ("Starteigenschaften" in the German version), activate "Enable XCMD". Save, and then restart the spawner (which you can do from SMC).

daithi1990
Obsidian | Level 7

I actually got it on Viya 3.3, if you go to 

 

vi /opt/sas/spre/config/etc/spawner/default/spawner_usermods.sh

 

&

 

vi /opt/sas/viya/config/etc/spawner/default/spawner_usermods.sh

 

Then add the following statement

 

USERMODS="$JREOPTIONS -allowxcmd"

 

Then restart the sas-viya-spawner-default service, you should be able to run system commands in procedures in Viya

 

 

 

 

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 5852 views
  • 0 likes
  • 2 in conversation