|
booth,
>I am curious how you get a program without a user-open display file to
>even start in batch without a severe error. I just had catastrophic
>results from exactly this scenario.
what is the error? Are you overriding the dspf to the device? Is the device
not signed on? You can only acquire a device that is not signed on.
here is code that works for me:
1. Add the following to 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
7. submit the job
SBMJOB CMD(BATMENU DEVICE(DSPxx)) JOB(BATMENU)
+---
| 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
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.