DATA Step, Macro, Functions and more

xcmd and %window start

Posts: 0

xcmd and %window start

I ran this code:

%MACRO RemoveFiles;
x del "&path\html\*.html";
%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.
Super Contributor
Super Contributor
Posts: 3,174

Re: xcmd and %window start

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.
Valued Guide
Posts: 2,174

Re: xcmd and %window start

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
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation