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.
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
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).
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
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.
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.
Ready to level-up your skills? Choose your own adventure.