nschroeder
Programmer
I am trying to call an RPGLE program from a CL four times. The RPG program has one output file defined and, based on the parameters passed, determines from the input file which records to write. It works fine, but I need it to write to four different spool file names (OTHPRT, OTHKSPRT, FMFMPRT, and FMFMKSPRT), and it's just creating four spool files with the same name (INVPRT). Can someone please tell me what I'm doing wrong? Here's the CL code:
CHGVAR VAR(&FMFM) VALUE(0)
CHGVAR VAR(&KS) VALUE(0)
CHGVAR VAR(&DVDTO) VALUE('OTHPRT')
CALLSUBR SUBR(DVDSUB)
CHGVAR VAR(&FMFM) VALUE(0)
CHGVAR VAR(&KS) VALUE(1)
CHGVAR VAR(&DVDTO) VALUE('OTHKSPRT')
CALLSUBR SUBR(DVDSUB)
CHGVAR VAR(&FMFM) VALUE(1)
CHGVAR VAR(&KS) VALUE(0)
CHGVAR VAR(&DVDTO) VALUE('FMFMPRT')
CALLSUBR SUBR(DVDSUB)
CHGVAR VAR(&FMFM) VALUE(1)
CHGVAR VAR(&KS) VALUE(1)
CHGVAR VAR(&DVDTO) VALUE('FMFMKSPRT')
CALLSUBR SUBR(DVDSUB)
SUBR SUBR(DVDSUB)
OVRPRTF FILE(INVPRT) TOFILE(&DVDTO) +
PAGESIZE(66 85) OVRFLW(65) PAGRTT(0) +
OUTQ(&OUTQ) FORMTYPE(&FORMTYPE) +
HOLD(*YES) USRDTA(&USRDTA)
CALL PGM(*LIBL/DVDINVSPLR) PARM(&FMFM &KS)
ENDSUBR
And here's the RPG file spec:
Finvprt o f 132 printer oflind(*inog)
I'm sure it's simple, but I'm rather limited on my CL/RPG skills. Also my first post to this forum.
Thanks much for any help.
CHGVAR VAR(&FMFM) VALUE(0)
CHGVAR VAR(&KS) VALUE(0)
CHGVAR VAR(&DVDTO) VALUE('OTHPRT')
CALLSUBR SUBR(DVDSUB)
CHGVAR VAR(&FMFM) VALUE(0)
CHGVAR VAR(&KS) VALUE(1)
CHGVAR VAR(&DVDTO) VALUE('OTHKSPRT')
CALLSUBR SUBR(DVDSUB)
CHGVAR VAR(&FMFM) VALUE(1)
CHGVAR VAR(&KS) VALUE(0)
CHGVAR VAR(&DVDTO) VALUE('FMFMPRT')
CALLSUBR SUBR(DVDSUB)
CHGVAR VAR(&FMFM) VALUE(1)
CHGVAR VAR(&KS) VALUE(1)
CHGVAR VAR(&DVDTO) VALUE('FMFMKSPRT')
CALLSUBR SUBR(DVDSUB)
SUBR SUBR(DVDSUB)
OVRPRTF FILE(INVPRT) TOFILE(&DVDTO) +
PAGESIZE(66 85) OVRFLW(65) PAGRTT(0) +
OUTQ(&OUTQ) FORMTYPE(&FORMTYPE) +
HOLD(*YES) USRDTA(&USRDTA)
CALL PGM(*LIBL/DVDINVSPLR) PARM(&FMFM &KS)
ENDSUBR
And here's the RPG file spec:
Finvprt o f 132 printer oflind(*inog)
I'm sure it's simple, but I'm rather limited on my CL/RPG skills. Also my first post to this forum.
Thanks much for any help.