CL program SET210

LANSA

CL program SET210
PGM PARM(&IOLIB1 &IOLIB2 &PFLIB1 &PFLIB2)

DCL &IOLIB1 *CHAR 10
DCL &IOLIB2 *CHAR 10
DCL &PFLIB1 *CHAR 10
DCL &PFLIB2 *CHAR 10

DCL &JOBMODE *CHAR 1

RTVJOBA TYPE(&JOBMODE)
IF COND(&JOBMODE *EQ '0') THEN(DO)
DSPPGMREF PGM(&IOLIB1/*ALL) OUTPUT(*OUTFILE) +
OUTFILE(QTEMP/S210PGMREF)

IF COND(&IOLIB2 *NE ' ') THEN(DO)
DSPPGMREF PGM(&IOLIB2/*ALL) OUTPUT(*OUTFILE) +
OUTFILE(QTEMP/S210PGMREF) OUTMBR(*FIRST *ADD)
ENDDO
DSPFD FILE(&PFLIB1/*ALL) TYPE(*RCDFMT) +
OUTPUT(*OUTFILE) FILEATR(*PF *LF) +
OUTFILE(QTEMP/S210RFID)

IF COND(&PFLIB2 *NE ' ') THEN(DO)
DSPFD FILE(&PFLIB2/*ALL) TYPE(*RCDFMT) +
OUTPUT(*OUTFILE) FILEATR(*PF *LF) +
OUTFILE(QTEMP/S210RFID) OUTMBR(*FIRST *ADD)
ENDDO

RUNQRY QRY(SET210QRY)
ENDDO
ELSE CMD(DO)
SBMJOB CMD(CALL PGM(SET210) PARM(&IOLIB1 &IOLIB2 +
&PFLIB1 &PFLIB2)) JOB(SET210XREF) /* +
Submit itself to batch */
SNDPGMMSG MSG('Job SET210XREF submitted to batch') MSGTYPE(*INFO)
ENDDO
ENDPGM