"Roger Harman" <RHarman@xxxxxxxxxx> wrote in message
news:mailman.5.1199314269.25518.midrange-l@xxxxxxxxxxxxxxx
I've done this too over the years for archiving reports for fiching,
burning to CD and later respooling. Works fine w/*FCFC. As noted, be
sure your PF is 1 longer than SPLF width.
Gregory/Roger,
OK. I found the CL that the Operations person had been experimenting with for this. I made (what I think are) the appropriate changes based on your suggestions. Not only is it not working but the first (left-most) character of the report is being truncated. I am not sure what I am missing. See if you see the problem.
The CL appears below. Please note that *PRTF CCIPRTF01 is defined as PAGESIZE(66 132 *ROWCOL). Both programs CRP130 and CRP140 write to printer file CCIPRTF01.
QRYGAIL: PGM PARM(&DATE &STARTSTEP &ENDSTEP)
DCL VAR(&DATE) TYPE(*CHAR) LEN(10)
DCL VAR(&STARTSTEP) TYPE(*CHAR) LEN(10)
DCL VAR(&ENDSTEP) TYPE(*CHAR) LEN(10)
DCL VAR(&USR_RC) TYPE(*DEC) LEN(8 0) VALUE(0)
/* Global Monmsg: take control of any called program's unhandled exceptions */
MONMSG MSGID(CEE9901) EXEC(GOTO CEE9901)
OVRPRTF FILE(CCIPRTF01) USRDTA(QRYGAIL) SPLFNAME(QRYGAIL) +
OUTQ(*JOB) CTLCHAR(*FCFC)
OVRPRTF FILE(CCIPRTF02) USRDTA(QRYGAIL) SPLFNAME(QRYGAIL) +
OUTQ(*JOB) CTLCHAR(*FCFC)
OVRPRTF FILE(*PRTF) USRDTA(QRYGAIL) OUTQ(*JOB)
/* create PF to hold cpysplf entries until all pgms have run */
DLTF FILE(QTEMP/QRYGAILSPL)
MONMSG MSGID(CPF2105) /* CONTINUE IF FILE NOT FOUND */
CRTPF FILE(QTEMP/QRYGAILSPL) RCDLEN(133) MAXMBRS(*NOMAX)
CRP140: /* point CCIPRTF01 to a unique splfname */
OVRPRTF FILE(CCIPRTF01) USRDTA(QRYGAIL) SPLFNAME(CRP140) OUTQ(*JOB) +
CTLCHAR(*FCFC)
IF COND(&DATE *EQ ' ') THEN(DO)
CALL PGM(CRP140)
ENDDO
ELSE CMD(DO)
CALL PGM(CRP140) PARM(&DATE)
ENDDO
CALL PGM(GET$RC) PARM(&USR_RC)
IF COND(&USR_RC *NE 0) THEN(GOTO ERROR)
/* extract report to PFM */
CPYSPLF FILE(CRP140) TOFILE(QTEMP/QRYGAILSPL) TOMBR(QRYGAILSPL) +
MBROPT(*REPLACE) CTLCHAR(*FCFC)
CRP130: /* redirect CCIPRTF01 to a new unique splfname */
OVRPRTF FILE(CCIPRTF01) USRDTA(QRYGAIL) SPLFNAME(CRP130) OUTQ(*JOB) +
CTLCHAR(*FCFC)
CALL PGM(CRP130)
CALL PGM(GET$RC) PARM(&USR_RC)
IF COND(&USR_RC *NE 0) THEN(GOTO ERROR)
/* extract report to PFM */
CPYSPLF FILE(CRP130) TOFILE(QTEMP/QRYGAILSPL) TOMBR(QRYGAILSPL) +
MBROPT(*ADD) CTLCHAR(*FCFC)
COMMONEND: /* redirect CCIPRTF01 back to original */
OVRPRTF FILE(CCIPRTF01) USRDTA(QRYGAIL) SPLFNAME(QRYGAIL) +
OUTQ(MNR) CTLCHAR(*FCFC)
/* now copy the PF member back to a printer file */
CPYF FROMFILE(QTEMP/QRYGAILSPL) TOFILE(CCIPRTF01) +
FROMMBR(QRYGAILSPL)
GOTO ENDPGM
CEE9901: SNDPGMMSG MSG('MSG CEE9901 CAPTURED: ABEND OF CALLED PROGRAM +
DETECTED')
GOTO ERROR
ERROR: CALL PGM(CCIABNDCL) PARM('QRYGAIL' &USR_RC 'N')
ENDPGM: ENDPGM
As an Amazon Associate we earn from qualifying purchases.