BookmarkSubscribeRSS Feed
makset
Obsidian | Level 7

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.

14 REPLIES 14
makset
Obsidian | Level 7

XWAIT 

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

not work

Tom
Super User Tom
Super User

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;

makset
Obsidian | Level 7
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;

Tom
Super User Tom
Super User

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;

makset
Obsidian | Level 7

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


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

Reeza
Super User

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

Tom
Super User Tom
Super User

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...

SassyJohn
Calcite | Level 5

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

Tom
Super User Tom
Super User

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

jakarman
Barite | Level 11

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 --<-----
yhz
Fluorite | Level 6 yhz
Fluorite | Level 6

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;


jakarman
Barite | Level 11

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 --<-----
Sushil_rsk
Calcite | Level 5

You can use  "options noxwait;"

 

Put this in before you start %sysexec.

 

This will help you get rid of keying in "EXIT" in the command prompt every time.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 14 replies
  • 10924 views
  • 1 like
  • 7 in conversation