• Subject: Re: batch job that uses a dspf.
  • From: "Alexei Pytel" <pytel@xxxxxxxxxx>
  • Date: Fri, 20 Apr 2001 11:13:08 -0500


It does not matter whether job type is interactive or batch. What matters
is whether job uses display I/O.
All interactive jobs use it by definition, but if batch job acquires a
display and tries to do display I/O, it will immediately become an
"interactive" in a sense, with all the consequences.

    Alexei Pytel



                                                                                
                   
                    "Steve Richter"                                             
                   
                    <srichter@AutoCoder       To:     <MIDRANGE-L@midrange.com> 
                   
                    .com>                     cc:                               
                   
                    Sent by:                  Subject:     batch job that uses 
a dspf.             
                    owner-midrange-l@mi                                         
                   
                    drange.com                                                  
                   
                                                                                
                   
                                                                                
                   
                    04/20/2001 02:36 AM                                         
                   
                    Please respond to                                           
                   
                    MIDRANGE-L                                                  
                   
                                                                                
                   
                                                                                
                   



On a server system, does a batch job that runs a pgm that writes to a dspf
run a full server speed, or does it run in the interactive penalty box and
cause the cpu wasting CFINT job to run?

To illustrate my question ...

The code at the end of the email will create a cmd, dspf and cl pgm. The
pgm, cmd and dspf are all named BatMenu.

The cl pgm will prompt a menu on the display and execute the selected
option.

The cmd is used to call the cl pgm with its one parameter: This parm
contains the name of the display device to write the menu to.

The cl pgm is intended to run in a batch job.  So it will OvrDspf its dspf
to the device name passed in parm 1.
        OvrDspf  BatMenu  Dev(&Device)

To run the pgm, do the following:
    1. Get the device name of a display that has a signon screen ( not
signed on )
    2. SBMJOB CMD(BATMENU DEVICE(sssss)) JOB(BATMENU)

When I run this on my system, the job type of the job is BATCH.

My question is: On a server model, does this BATCH job that writes to a
display terminal run at full server speed or does it run in the interactive
penalty box and cause the cpu wasting CFINT job to run?

The code follows. I have included it in case what I am asking is not clear.
Or it might be usefull as tutorial on the use of the Device parm of the
OvrDspf cmd.

Thanks for the help,
Steve Richter


1. Add the following to a srcmbr BatMenu in qgpl/qcmdsrc:
            CMD        PROMPT('Batch job display test')
            PARM       KWD(DEVICE) TYPE(*CHAR) LEN(10) +
                         PROMPT('Device name')
2. Create the command:
        CrtCmd  qgpl/batmenu qgpl/qcmdsrc batmenu

3. Add the following source code to dspf srcmbr BatMenu in qgpl/qddssrc:
 A          R BATMENU1
 A                                  2  2'MENU'
 A                                  4  2' 1. SNDMSG'
 A                                 10  2'90. SIGNOFF'
 A                                 12  2'OPTION:'
 A            OPTN           2  0B 12 10EDTCDE(Z)
4. Create the dspf:
        CrtDspf qgpl/batmenu qgpl/qddssrc batmenu

5. Add the following source code to clp srcmbr BatMenu in qgpl/qclsrc:
             PGM        PARM(&DEVICE)
             DCL        VAR(&DEVICE) TYPE(*CHAR) LEN(10)

             DCLF       FILE(BATMENU)
             DCL        VAR(&JOB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&USER) TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOBTYPE) TYPE(*CHAR) LEN(1)

             OVRDSPF    FILE(BATMENU) DEV(&DEVICE)
/* OVERRIDE YOUR APPLICATIONS DISPLAY FILES HERE.      */

 B1:         DO
             CHGVAR     VAR(&OPTN) VALUE(0)
             SNDRCVF    RCDFMT(BATMENU1)
             IF         COND(&OPTN *EQ 90) THEN(GOTO CMDLBL(E1))

             IF         COND(&OPTN *EQ 1) THEN(DO)
             RTVJOBA    JOB(&JOB) USER(&USER) TYPE(&JOBTYPE)
             SNDMSG     MSG('Job' *BCAT &JOB *BCAT 'is job type' +
                          *BCAT &JOBTYPE) TOUSR(&USER)

             ENDDO

             GOTO       CMDLBL(B1)
 E1:         ENDDO

             ENDPGM
6. Create the cl pgm
            CrtClPgm  qgpl/batmenu  qgpl/qclsrc




+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].