Help using Base SAS procedures

x or %sysexec command

Reply
Contributor
Posts: 28

x or %sysexec command

Hello

I have a question about the
x or %sysexec command options .

Is possible to use these commands so as not appeared cmd window?

I use them in batch sessions very often, and they hinder my work.

Thank you for your help.

Super User
Posts: 17,724

Re: x or %sysexec command

Contributor
Posts: 28

Re: x or %sysexec command

XWAIT 

means that the command prompt session waits for you to type EXIT before you can return to your SAS session.

not work

Super User
Super User
Posts: 6,495

Re: x or %sysexec command

I would suggest replacing any X commands with data _null_ steps instead.  For %SYSEXEC() you might need to check what else the program is doing as it might not be an appropriate place to introduce a step boundary.

Replace

x echo hello ;

With


data _null_;

  infile "echo hello" pipe;

  input;

  put _infile_;

run;

Contributor
Posts: 28

Re: x or %sysexec command

In simple commands work, but I have this:

%let log = -log "&CodePatch";                or         %let log = -nolog; 


%sysexec start /high sas.exe  -icon -noterminal -nosplash -noxwait -noxsync -CONFIG 

  "C:\Program Files\SAS\SASFoundation\9.2\SASV9.CFG" -SYSIN "&CodePatch._GlobalControl_1.sas" &log;

Super User
Super User
Posts: 6,495

Re: x or %sysexec command

Use the quote() function.

%let command=any valid command with any type of quoting ;

data _null_;

  infile %sysfunc(quote(&command)) pipe;

  input;

  put _infile_;

run;

Contributor
Posts: 28

Re: x or %sysexec command

Is perhaps still some other option? because thus, locks the session SAS


Session which calls your command runs until the end of session induced.

Super User
Posts: 17,724

Re: x or %sysexec command

I don't think we understand your question. Can you be more explicit please?

Super User
Super User
Posts: 6,495

Re: x or %sysexec command

If you are trying to use this to run an asynchronous process then data _null_ step is NOT what you want.

To your original question you probably want to set the option NOXWAIT to prevent leaving the command window open.  You might also look at NOXSYNC.

http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#exittemp.htm

Also did you try the SYSTASK command instead?

http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#win-stmt-systask.h...

N/A
Posts: 1

Re: x or %sysexec command

Tom,

I am looking at the %CMS command which is similar to the x command and I am having difficulties getting started.  I am trying to pull data from AVAYA cms and don't know how to write the code nor can I find documentation.  Do you have any idea how the code might look?

Thanks

Super User
Super User
Posts: 6,495

Re: x or %sysexec command

I haven't used an IBM machine running VM/CMS since we migrated to OS/2.

Valued Guide
Posts: 3,208

Re: x or %sysexec command

Do you search for adding the -nodms option for the batch script so the dms system will not come SAS(R) 9.3 System Options: Reference, Second Edition

---->-- ja karman --<-----
Contributor yhz
Contributor
Posts: 21

Re: x or %sysexec command

If you want to run batch job without the cmd window or DOS window poping up, add the following option on top of SAS code:

options noxwait;


Valued Guide
Posts: 3,208

Re: x or %sysexec command

The CMS is an oldy: Statements : CMS (v8 and esa/cms dedicated). A shell escape for interactive typing is not well accepted these days 

You have to decide what you are needing.

a/ only a start of some program without any feedback on the results (asynchroon processin) tha using noxwait

b/ starting a program and needing the results/feedback than use the pipe approach.

c/ some system are support a proo setup for calling programs.

As you are trying to pull data form AVAYA CMS start at that side finding the technical description of that product retrieving data.

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 13 replies
  • 1764 views
  • 1 like
  • 6 in conversation