BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I ran this code:

%MACRO RemoveFiles;
x del "&path\html\*.html";
%MEND;
%RemoveFiles;
%window start
#4 @22 'test' COLOR = BLUE attr = underline
#9 @10 'test1' COLOR = RED @90 FRQ 2 attr=underline color=RED REQUIRED = YES 14 @10 'Press ENTER to continue' COLOR = RED;
%display start;

and received this error:

MPRINT(REMOVEFILES): x del "C:\Documents and Settings\test\html\*.html";
WARNING: Shell escape is not valid in this SAS session.
14 %RemoveFiles;
ERROR 22-322: Syntax error, expecting one of the following: a name, #, +, @.
ERROR: %WINDOW statement not processed due to errors.
15 %window start

I also ran proc options option=xcmd; run;
and got this:

NOXCMD The X Command is not valid in this SAS session

Any ideas?
Thank you.
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
It's a CONFIG setting you will need to control, either allowing or disallowing XCMD. Refer to the SAS Windows Companion DOC for details. Also, consider CALL SYSTEM as an alternative.

Scott Barry
SBBWorks, Inc.
Peter_C
Rhodochrosite | Level 12
although you are unable to issue system commands while the NOxcmd option is in effect, there is an FDELETE() function. I'm not sure if NOxcmd prevents that function having effect

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
  • 646 views
  • 0 likes
  • 3 in conversation