BookmarkSubscribeRSS Feed
Nieumysl
Calcite | Level 5

Hi,

I'm trying to run this windows cmd instruction from SAS (when executed from cmd, it works perfectly fine) :

for /f "usebackq tokens=2*" %i in (`svn st ^| findstr /R "^!"`) do svn del "%i"


Now, tried everything: x, system from scl, quotations... nothing works - the issue seems to be the variables, which get interpreted as macro definitions, but there seems to be no way around that... Can anybody help me with that?

2 REPLIES 2
JakobHommelhoff
SAS Employee

Hi Nieumysl

Have you tried this approach:

filename cmd pipe "<your cmmand>" lrecl=2048;

data _null_;

  infile cmd;

  input;

  put _infile_;

run;

The benefit here is that you can see the command-prompt messages in the sas-log.

Another approach that might be helpful is to write the command to a .bat or .cmd file.

and call the the bat/cmd from SAS in whatever way.

Br, Jakob Hommelhoff

Nieumysl
Calcite | Level 5

Thanks Jakob! 🙂 It works swimmingly :smileygrin:

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 392 views
  • 2 likes
  • 2 in conversation