BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mike_bn
Obsidian | Level 7

Tom, all you wrote makes sense to me (If I understand it correctly).

"I think the problem is the attempt make some distinction between a "batch" mode and a "non-interactive" mode"

I totally agree, but SAS unfortunatley exactly doing that in its doc when it groups BASE SAS execution modes into

4 different types: Windows Environment mode, Interactive Line mode, Batch-mode and Non-Interactive mode. The more I think about it, this grouping is unfortunate and creates confusion. Alle the examples you gave about jobs that you would call batch jobs and job's you would not call batch jobs make me believe, when I submit   'sas xxx.sas' from the command line, I would call it just 'non-interactive mode' and when in addition it is scheduled, I would call it 'non-interactive mode running as a batch job'

Tom
Super User Tom
Super User

Exactly.  So your last sentence is a good summary of the distinction between those two. 

 

The distinction between the other to is the concept of windowing.  In the old original interactive mode (more like the mode of original BASIC programs) you can just type commands and see results.  You cannot jump around using mouse of arrow keys and interact with multiple windows.  It is like the difference between editing a file using a command editor like edlin and and more GUI tool like vi or EMACS.

Quentin
Super User

@Tom wrote:

I think the problem is the attempt make some distinction between a "batch" mode and a "non-interactive" mode. 

 

As is normal with computer terminology existing words are adopted and attached to very specific concepts that have only a passing relationship with the ordinary meaning of those words.

 

BATCH is a pretty well defined concept in computers (at least to us old timers) and is not the same as just running a program.  Just running a program at the terminal is not batch.  I don't call it "batch" if I run a compiler. 

 

When I ran SAS from the REXX text editor on a VM/CMS machine I was not running a "batch" job.  The editor script would save the program file and use SAS to run the program.  That was a "non-interactive" run if you will.  So are those that use similar scripts in EMACS to do the same thing on UNIX systems. 

 

If you have a JOB card you are submitting a batch job.  Tools like LSF are using batch queues to run jobs. 

 

When I ran SAS from the WYLBER editor on a MVS system in the 1980's the files I submitted to run had JOB cards are were sent to be batch run.  That was running in batch.


Well, I would call everything you described batch. : )

 

But again, I learned the term "batch submit" within the SAS context.

 

This makes me curious when SAS introduced the term "batch submit".  I suppose the original SAS didn't have an interactive line mode.  Maybe the introduction of interactive line mode is what led them to introduce the 'batch' term? 

 

I started in 6.12, so don't know that history.  I do have a SAS '78 manual at home, I'll have to check...

SASKiwi
PROC Star

@Quentin - Batch processing on an MVS-style mainframe has a special meaning. When you submit a batch job on MVS it goes off to a special application that queues and processes (and manages resources) of batch jobs in sequence, almost like a mini VM. This is NOT the same as just executing a non-interactive SAS job by calling the SAS executable directly. FYI, IBM's LSF scheduler provides similar functionality on Unix and Windows. When you run SAS jobs via LSF, it is LSF that controls the queuing and execution of the SAS jobs. For example you can limit the number of SAS jobs that are allowed to run simultaneously.

 

To summarise, batch processing occurs when you run SAS via a third-party batch controller or scheduler app. Non-interactive processing is when call the SAS executable directly with a SAS program(s) as input.   

Quentin
Super User

@SASKiwi I don't have MVS mainframe experience, but I'm willing to accept that "batch processing" has a meaning in that context.

 

That said, I think "batch" also has a meaning in the context of SAS.  On Windows, if I right-click a .sas program it brings up a SAS context menu that says "batch submit."  If I invoke SAS from a command prompt on Window or Linux (i.e. issue the command: sas foo.sas), I think most of the SAS community would also call that a "batch submit".  I've used LSF to schedule jobs on Linux, but I see that as controlling when/whether to execute a batch job.  Or even simpler, consider cron. Whether I enter the command sas foo.sas at a command prompt, or use cron to schedule that command, I see them both as batch submissions.   Again, in the context of SAS.  As discussed in the docs, e.g. https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostunx/n0x9esc5c95qg4n1wogx5u2k7354.htm and https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/p16esisc4nrd5sn1ps5l6u8f79k6.htm#p01f... 

SASKiwi
PROC Star

@Quentin  - Totally agree with you. I guess it's easier for SAS to put "Batch submit" on context menus rather than the more confusing and less understood "Non-interactive submit".

 

All I'm trying to do is make the distinction between running a SAS program directly and putting a SAS program into a batch queuing and processing app. The behaviour is quite different, even if you call both of them "batch processing".  

Tom
Super User Tom
Super User

@SASKiwi wrote:

@Quentin  - Totally agree with you. I guess it's easier for SAS to put "Batch submit" on context menus rather than the more confusing and less understood "Non-interactive submit".

 

All I'm trying to do is make the distinction between running a SAS program directly and putting a SAS program into a batch queuing and processing app. The behaviour is quite different, even if you call both of them "batch processing".  


Exactly. 

 

I don't but much store into SAS's use of language anyway.  I just submitted a suggestion to the documentation team to fix one of their pages that was mistakenly using the term MACRO for macro language symbols (commonly called macro variables).

mike_bn
Obsidian | Level 7

In case anyone is interested, I got in touch with a SAS employee who is responsible for this part of the

SAS-doc (the chapters about different SAS modes, in particular the Unix companion). I outlined my reasoning

why I think that talking about two different SAS modes in Unix, where one mode is called 'bacth mode' and another one is called 'non-interactive' modes is problematic for several reasons (in Unix!!, in don't know about the other OS, in other OS it might make sense). First off, keep in mind, that when you call one way of executing SAS 'batch mode' this mode will in most cases be non-interatcive as well (unless there are statements that require user input). So this is already confusing and raises the question whether it is a good idea to regard 'batch mode' and 'non-intewratcive mode' as two mutually exclusive different things. I think it is not a good idea because sometimes a job is BOTH. One more important thing is that if you call something 'batch mode' one first must come up with a precise definition what exactly a 'btach job' is. When you google it most of the time the definitions/scenarios described is the classical one of having multiple jobs (batch of jobs) which are scheduled by some job-scheduler or put in some 'batch queue' sorted by whatever priority criteria and then executed (automatically!). I feel most would agree that these jobs are then called 'batch jobs'. But if one single user is sitting in front of his unix shell window and MANUALLY  types 'sas xxx.sas'  or  'sas xxx.sas. &'  and then hitting  enter - can this be really called submitting a BATCH job? What is the batch of jobs this one job is part of?  Or wouldn't it rather be tthe proper way to just call it 'manual execution of a sas job'?  If you take the  stance that even some manual shell submit from a user sitting in front of his pc is a batch job, then the consquence would be that there are only THREE different SAS modes and not four, like the offical sas doc says (in Unix )!. The three modes would be windows environment mode,interactive line mode and batch mode (and the batch mode would be non-interactive most of the time) Because what would be the way then to execute SAS in non-interative mode which is NOT also batch mode ? I can't think of any. The only way I can think of to really have 4 different SAS modes (Window Env Mode, Interactive Line Mode, Batch Mode, Non-Interactive Mode) is if you refuse calling a manual  user submit of 'sas xxx.sas' or 'sas xxx.sas &'  a batch job.Then this would be the non-interactive mode and batch mode would only be if the same command ('sas xxx.sas' or 'sas xxx.sas &')  is submitted automatcially by some job scheduler (among many other jobs).

 

In my mind personally, SAS only has three modes

1. Window Env Mode  (sas -dms')

2. Interatcive Line Mode (sas -nodms)

3, Non-Interatcive Mode

 

The third mode has 3 variations which are

3a.   'sas mysas.sas' manually submitted by a user -> sas is non-interactivley running in the foreground

3b.   'sas mysas.sas &' manually submitted by a user -> sas is noninteratcivley running in the background

3c.   'sas mysas (&)'  scheduled by some job scheduler like cron  --> sas is started automatically , and also runs non-interactively.

 

If you desperately want to keep the classification of having 4 modes tin Unix (eg. to stay consistent with other OS), I feel that only 3c. should be the case that can be called 'Batch mode', but I could be wrong about that.

 

In any way, SAS agreed with me that the current doc state needs to be optimized which they intend to do.

 

Quentin
Super User

I can live with this:


In my mind personally, SAS only has three modes

1. Window Env Mode  (sas -dms')

2. Interactive Line Mode (sas -nodms)

3, Non-Interactive Mode

Since I've never played with Interactive Line Mode to understand how the code execution differs from an interactive (Display Manager) session, I'd also be happy with just two modes:

  1. Interactive
  2. Batch / Non-interactive

I see the definition of interactive being a session that allows me to interactively submit code to a SAS session, review results from that submission, and then submit more code to the same session.  In a Windows Display Manager interactive session, you can submit code one step-at-a-time, or statement-at-a-time, or even one token-at-a-time.  So it's interactive code submission.

 

In batch mode you have to submit... wait for it... a single 'batch' of SAS code.   Maybe people would be happier to call this a SAS job?  (The SAS 1979 manual is obviously pre-Windows so doesn't discuss interactive or batch; it uses 'job').  And that code will be run to completion during a single session that is created to run the code and then ends after the code has completed executing.

 

But, clearly SAS developers agree that the 'batch' term may cause confusion. Studio has what I would call a a batch submit feature.  According to this paper, https://support.sas.com/resources/papers/proceedings17/SAS0417-2017.pdf, Studio 3.5 originally called it 'batch submit' before changing to 'background submit' in 3.6.  

 

One reason it's important to distinguish between interactive mode and batch mode is that the SAS language itself can perform differently in these different modes.  There are system options, such as SYNTACHECK, which apply only to batch mode/non-interactive mode, and statements (such as ABORT) which have different effects in different modes https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/p0hp2evpgqvfsfn1u223hh9ubv3g.htm  .

ballardw
Super User

In my mind personally, SAS only has three modes

1. Window Env Mode  (sas -dms')

2. Interatcive Line Mode (sas -nodms)

3, Non-Interatcive Mode

Actually in the DMS you can run an entire program script, i.e. Submit the entire program, or submit one (or more) lines at a time. While the later may not make sense for most procedures the ones that will do Run Group Processing like Proc Datasets or Proc Reg, that is a valid option. So within the DMS there are different levels of "interactive" mode.

 

Consider the Program Editor command SUBTOP <n>. You could even set a Keys entry to run just the first N lines of a program file...

mike_bn
Obsidian | Level 7

Yeah sure, but whatever levels of interactivity the Windows Env Mode has, it is still a distinctly different

mode compared to the other modes, unlike 'batch mode' vs 'non-interactive' mode where it is somewhat unclear in the

offical SAS unix doc what the exact definitions of those two modes are, as even the doc itself is contradictory,

not all chapters describe the modes the same way. But as I mentioned, the SAS guys responsible for the doc plan to update all in that regard, to make everything correct and consistent everywhere. I am really pleasantly surprised that they gave

my arguments some thought and did not discard them right away.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 25 replies
  • 5833 views
  • 13 likes
  • 5 in conversation