BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
t_ar_taat
Quartz | Level 8

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!

1 ACCEPTED SOLUTION
5 REPLIES 5
t_ar_taat
Quartz | Level 8

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

Tom
Super User Tom
Super User

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? 

 

t_ar_taat
Quartz | Level 8
Thank you Tom,I never know "DMS" and "NODMS".I'll someday use this knowledge 🙂
Quentin
Super User

Just a warning that if you batch submit on Windows, &SYSENV = FORE.  I've been burnt by this many times.

 

The docs mention this:

Operating Environment Information:   Some operating environments do not support the submission of jobs in batch mode. In this case the value of SYSENV is always FORE. For details, see the SAS documentation for your operating environment

 

From the docs, looks like on Windows the only setup that gives you &SYSENV=BACK is Enterprise Guide.

 

 

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 4319 views
  • 3 likes
  • 4 in conversation