BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am trying to run a batch file through the SAS session after it has run a SAS program. Using x command, this could be run. But what particular x command will run the bat say if I am having the batch file on a network drive “p:\sas\mybatch.bat”. I tried
X call “p:\sas\mybatch.bat”; or call system(‘cd p:\sas\mybatch.bat’), but no luck. I guess I am missing something. Could you please help me to identify my mistake.

data _null_;
command ='cd' ||'c:sas\copy_datasets.bat';
call system (command);
run;
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
You first need to read the documentation more carefully. The format for the X command does not include the "call". It would be just

x 'p:\sas\mybatch.bat';

Also, the MS-DOS "CD" command takes as it's argument a directory rather than a file name.
deleted_user
Not applicable
Thanks. That worked!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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