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

Hello everyone,

 

in SAS Viya 3.5 I am executing a SAS Code in SAS Studio to check a Linux directory for files.

"Pipe command="ls -1 /opt/sas/ftrans/*.csv"

NOTE: 17 records were read from the infile RDFILES."

 

That SAS Code returns no error. Also, the user being used has read and writing capabilities in the specified directory.

 "[user@server]$ touch a.txt
 [user@server]$ pwd
 /opt/sas/ftrans"

 

However, when i schedule the job in SAS Viya 3.5 I get permission denied.

"MPRINT(READFILES): filename rdfiles pipe "ls -1 /opt/sas/ftrans/*.csv";
 ERROR: Insufficient authorization to access PIPE."

 

Any ideas?

 

1 ACCEPTED SOLUTION

Accepted Solutions
fracou111
Calcite | Level 5

Hello everyone,

 

thank you for your inputs. However it seems the answer relies inside SAS Viya.

 

To allow SAS Studio to execute Linux commands, go to Environment Manager > Compute Contexts > SAS Studio Compute Context and add an attribute "allowXCMD" with the value "true".

 

To allow SAS Viya scheduled jobs to execute Linux commands, go to Environment Manager > Compute Contexts > SAS Job Execution Compute Context and add an attribute "allowXCMD" with the value "true".

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

@fracou111 wrote:

Hello everyone,

 

in SAS Viya 3.5 I am executing a SAS Code in SAS Studio to check a Linux directory for files.

"Pipe command="ls -1 /opt/sas/ftrans/*.csv"

NOTE: 17 records were read from the infile RDFILES."

 

That SAS Code returns no error. Also, the user being used has read and writing capabilities in the specified directory.

 "[user@server]$ touch a.txt
 [user@server]$ pwd
 /opt/sas/ftrans"

 

However, when i schedule the job in SAS Viya 3.5 I get permission denied.

"MPRINT(READFILES): filename rdfiles pipe "ls -1 /opt/sas/ftrans/*.csv";
 ERROR: Insufficient authorization to access PIPE."

 

Any ideas?

 


Your scheduled job runs with

options noxcmd;

Check the configuration files that the scheduled jobs use, as the option is set at startup and cannot be changed later.

gwootton
SAS Super FREQ

<SASConfig>/Lev1/SASApp/BatchServer/sasbatch.sh executes sas with the noxcmd option, so you'd need to modify that file and change "noxcmd" to "xcmd":

[sas@host ~]$ egrep -n '^exec.*xcmd' /sas94/config/compute/Lev1/SASApp/BatchServer/sasbatch.sh
28:exec "$SAS_COMMAND" -noxcmd -lrecl 32767 "$@" "${USERMODS_OPTIONS[@]}"
--
Greg Wootton | Principal Systems Technical Support Engineer
fracou111
Calcite | Level 5

Hello everyone,

 

thank you for your inputs. However it seems the answer relies inside SAS Viya.

 

To allow SAS Studio to execute Linux commands, go to Environment Manager > Compute Contexts > SAS Studio Compute Context and add an attribute "allowXCMD" with the value "true".

 

To allow SAS Viya scheduled jobs to execute Linux commands, go to Environment Manager > Compute Contexts > SAS Job Execution Compute Context and add an attribute "allowXCMD" with the value "true".

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 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1257 views
  • 1 like
  • 3 in conversation