Architecting, installing and maintaining your SAS environment

how to run shell command through SAS DI jobs ?

Accepted Solution Solved
Reply
Contributor
Posts: 36
Accepted Solution

how to run shell command through SAS DI jobs ?

HI all ,

 

I am trying to run shell in SAS DI job but it is giving below error :-

ERROR: Shell escape is not valid in this SAS session.

 

I have tried this workaround mentioned in http://support.sas.com/kb/41/058.html and  took restart also.

 

Please guide me how to run shell command in SAS DI job .

 

Many thank in advance.


Accepted Solutions
Solution
‎02-07-2017 05:28 AM
User
Posts: 1

Re: how to run shell command through SAS DI jobs ?

You have to enable sasbatch to run xcmd

Check the sasbatch.sh file you should have a line like the following:

"$SAS_COMMAND" -noxcmd -lrecl 32767 "$@" "${USERMODS_OPTIONS[@]}"

Change the "-noxcmd" option for "-xcmd" and it should work

Sorry about my english

View solution in original post


All Replies
Super User
Posts: 6,936

Re: how to run shell command through SAS DI jobs ?

Doesn't DI Studio use the Data Step Batch Server for running its jobs? So you might have to look in another place to change the configuration (the sasbatch.sh file)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 5,256

Re: how to run shell command through SAS DI jobs ?

Well, yes, the deployed jobs from DI Studio is usually executed from the Data Step Batch Server.

But the interactive DI Studio sessions uses the standard Workspace Server.

If you think that you followed the steps in note, and still have the problem, contact tech support that should be able to walk you through the steps in detail.

Data never sleeps
Solution
‎02-07-2017 05:28 AM
User
Posts: 1

Re: how to run shell command through SAS DI jobs ?

You have to enable sasbatch to run xcmd

Check the sasbatch.sh file you should have a line like the following:

"$SAS_COMMAND" -noxcmd -lrecl 32767 "$@" "${USERMODS_OPTIONS[@]}"

Change the "-noxcmd" option for "-xcmd" and it should work

Sorry about my english
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 265 views
  • 2 likes
  • 4 in conversation