DATA Step, Macro, Functions and more

Way of catch "Batch Mode" or "Interactive mode"

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

Way of catch "Batch Mode" or "Interactive mode"

While the program is running, whether it is an execute by interactive mode or batch submit, is there any way to get by batch mode or interactive mode?

Though the programmer is know it by his eyes or operation.

 

For example,these codes which you run in a batch submit, there is a little a problem.(a window is shown.)

dm "output; clear; odsresults; clear;";

http://support.sas.com/kb/44/705.html

 

To avoid this, I would want to get my "run;" is by batch submit or interactive mode for make "If statement ".

If "&mode_now" know this,I would make these "if branching".


%if            &mode_now = "batch" %then %do;
%end;
%else %if &mode_now = "interactive" %then %do;
dm "output; clear; odsresults; clear;";
%end;

 

Best Regards!


Accepted Solutions
Solution
‎09-26-2016 09:27 AM
Super User
Posts: 17,750

Re: Way of catch "Batch Mode" or "Interactive mode"


All Replies
Solution
‎09-26-2016 09:27 AM
Super User
Posts: 17,750

Re: Way of catch "Batch Mode" or "Interactive mode"

Contributor
Posts: 35

Re: Way of catch "Batch Mode" or "Interactive mode"

Hi,Reeza.
Thank you so much your kindness everytime!
I confirm that &SYSENV would work what I want to grasp with the value "FORE" or "BACE".

Super User
Super User
Posts: 6,497

Re: Way of catch "Batch Mode" or "Interactive mode"

[ Edited ]

Probably better to use DMS settng since you are explicitely using DM command.

It is possble to have SYSENV=FORE and NODMS.

 

NOTE: SAS initialization used:
      real time           0.14 seconds
      cpu time            0.02 seconds
      
  1? %put &sysenv %sysfunc(getoption(dms)) ;

FORE NODMS

  2? 

 

Contributor
Posts: 35

Re: Way of catch "Batch Mode" or "Interactive mode"

Thank you Tom,I never know "DMS" and "NODMS".I'll someday use this knowledge Smiley Happy
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 614 views
  • 2 likes
  • 3 in conversation