JDE Standard CL Logic

sdJDE

Member
Dear All,

I am working on JDE Worldsoft a7.3 cum 9.
Could anyone help me in understanding the JDE standard CL logic for a report program in Worldsoft. Some of the commands are given below. I need an explanation for the same. Your help is highly appreciated.


/* --------- Global CPF error intercept. --------------------------- */
MONMSG MSGID(CPF0000 CPC0000 CPD0000) EXEC(GOTO +
CMDLBL(ABEND))
/* --------- Override JDE Message File for Language Preference ----- */
CALL PGM(J98850) PARM(&LANGMSGF)
MONMSG MSGID(CPF0000 CPD0000 CPC0000)
OVRMSGF MSGF(QJDEMSG) TOMSGF(&LANGMSGF)
MONMSG MSGID(CPF0000 CPD0000 CPC0000)

* --------- Retrieve job name and submitting message queue. ------- */
RTVJOBA JOB(&JOBID) SBMMSGQ(&PSMSGQ) TYPE(&JOBTYPE)
IF COND(&JOBTYPE='1') THEN(DO)
SNDPGMMSG MSGID(JDE9991) MSGF(QJDEMSG) +
MSGDTA('J58510 ') TOPGMQ(*EXT)
MONMSG MSGID(CPF0000 CPC0000 CPD0000)
GOTO EOJ
ENDDO
/* --------- Set special printer file library, if specified. ------- */
RTVDTAARA DTAARA(*LDA (1 10)) RTNVAR(&PRTFLIB)
IF COND(&PRTFLIB *NE ' ') THEN(DO)
ADDLIBLE LIB(&PRTFLIB) POSITION(*FIRST)
MONMSG MSGID(CPF0000 CPC0000 CPD0000)
ENDDO

/* --------- Output file override for OPNQRYF, *SHARE. ------------- */
OVRDBF FILE(F04573 ) SHARE(*YES)
/* --------- Call DDS Writer file processor. ----------------------- */
CALL PGM(P98315) PARM(&PSPID &PSVERS &PSFILE +
&PSMBR &PSMSGQ)
IF COND(%SWITCH(1XXXXXXX)) THEN(DO)
GOTO EOJ
ENDDO
/* --------- Issue override if not processing open query. ---------- */
IF COND((&PSMBR *NE '*OPNQRYF') +
*AND (&PSMBR *NE '*SQL')) THEN(DO)
OVRDBF FILE(F04573 ) TOFILE(&PSFILE) MBR(&PSMBR)
ENDDO


ABEND:
SNDPGMMSG MSGID(JDE9999) MSGF(QJDEMSG) MSGDTA(&JOBID) +
TOMSGQ(&PSMSGQ)
MONMSG MSGID(CPF0000 CPC0000 CPD0000)
CHGJOB LOG(4 00 *SECLVL) SWS(1XXXXXXX)
MONMSG MSGID(CPF0000 CPC0000 CPD0000)
/* --------- End of job processing --------------------------------- */
EOJ:
/* --------- Remove Dream Writer logical file member: -------------- */
/* --------- If job switch 2 is on, logical is permanent --------- */
/* --------- system logical, do not remove member. --------------- */

IF COND(%SWITCH(X0XXXXXX) +
*AND (&PSMBR *NE '*OPNQRYF') +
*AND (&PSMBR *NE '*SQL')) THEN(DO)
DLTF FILE(&PSFILE)
MONMSG MSGID(CPF0000 CPC0000 CPD0000)
ENDDO
IF COND(&PSMBR = '*OPNQRYF') THEN(DO)
CLOF F04573
MONMSG MSGID(CPF0000 CPC0000 CPD0000)
DLTOVR F04573
MONMSG MSGID(CPF0000 CPC0000 CPD0000)
ENDDO

/* --------- If a Recursive version, delete version. --------------- */
IF COND(&PSPID *LT 'A') THEN(DO)
CALL PGM(P98305) PARM(&PSPID &PSVERS)
MONMSG MSGID(CPF0000 CPC0000 CPD0000)
ENDDO
ENDPGM


In addition, could anyone explain the LOKUP command in RPG.

Thanks.

Regards,
SD
 
What you are asking is that someone take
the time to go line by line and explain the CL?

I would hope that you have read and understand
the CLP manuals and that the only parts you need
is the "JDE" Specific stuff like the fact that
Version List Entries can be both UNIQUE and NON-UNIQUE?

For instance, when you run a postingjob, every user
that runs it gets their own version list entry because it is
a "+" version list. The REMOVE VERSION housekeeping at the end
where is looks to see if the version is less than "A" (e.g. "+")
takes care of deleting the unique versions at Job End.

The MONMSG is a lot like the old DOS command ONERROR.
If ANYTHING happens that generates any error messages
(Or a specific error message, also) the action (DO) is
executed.

Hopefully this is a start on your long path ... I remember
way back in '88 looking at all that stuff and just marveling
at how elegant some of it is.
 
Back
Top