Developers

A forum for collaboration, Q&A, and knowledge sharing on SAS and open source integration
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 6916 views
  • 0 likes
  • 2 in conversation