Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Shell Scripts from within SAS

Status
Not open for further replies.

LuckySkunk

Technical User
Oct 7, 2004
11
MY
Hi

I'm new. Is it possible to run a shell script from within the SAS program? Thanks in advance.

Regards.
 
I've had situations where I've had to execute a vb script from SAS. However for that, the vb script was a seperate file and I used the "x" function in SAS to run it.

Code:
  [COLOR=blue]x[/color] [COLOR=purple]'"c:\temp\my_vbs_file.vbs"'[/color];

 
As dblan says, it is possible to submit external OS commands from SAS (including getting scripts to run). However this cannot be done if you are working through Enterprise Guide.
You can also use SYSTASK to do that same thing as X...
I used this to create a list of the files in a directory which I could then read in and use to build dynamic code to read in all the files.
Code:
/* Create list of files to be read in */
systask command "DIR /B ""&RAWPATH.\*.csv"" >Filelist.txt" WAIT;
The WAIT option tells SAS to not proceed until the task has completed.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top