IF COND(&EXTYPE = *AFTER) THEN(GOTO +
CMDLBL(STEP3_AFT))
GOTO CMDLBL(STEP4)
/******************************************************************************/
/* */
/* STEP 3: Perform specific commands depending on calling */
/* ------- exit point in APYPRTDEF */
/* */
/******************************************************************************/
/******************************************************************************/
/* SAMPLE CODE FOR *BEFORE */
/******************************************************************************/
STEP3_BEF:
SNDMSG MSG(’APU starts to process’ *BCAT &EXJOBUSR +
*TCAT ’’’s’ *BCAT ’spooled file’ *BCAT +
&EXINFILE *TCAT ’.’ *CAT &EXINNBR *BCAT +
’type’ *BCAT &EXINTYPE *BCAT ’from output +
queue’ *BCAT &EXINOQLB *TCAT ’/’ *CAT +
&EXINOQNM) TOUSR(*SYSOPR)
GOTO CMDLBL(STEP4)
/******************************************************************************/
/* SAMPLE CODE FOR *MIDDLE */
/******************************************************************************/
STEP3_MID:
SNDMSG MSG(’APU starts to generate AFP data using +
print definition’ *BCAT &EXPRTDLB *TCAT +
’/’ *CAT &EXPRTDEF *TCAT ’. (FYI: The +
parameter at runtime for the program +
which sent the message to you was -->’ +
*CAT &EXUSRPRM *CAT ’<--)’) TOUSR(*SYSOPR)
GOTO CMDLBL(STEP4)
/******************************************************************************/
/* SAMPLE CODE FOR *AFTER */
/******************************************************************************/
STEP3_AFT:
IF COND(&EXSUCFLG = *YES) THEN(GOTO +
CMDLBL(AFT_SUCC))
ELSE CMD(GOTO CMDLBL(AFT_FAIL))
AFT_SUCC:
SNDMSG MSG(’APU successfully created the AFPDS +
spooled file’ *BCAT &EXOTFILE *BCAT ’in +
the output queue’ *BCAT &EXOTOQLB *TCAT +
’/’ *CAT &EXOTOQNM *BCAT ’with the flags +
HOLD(’ *CAT &EXOTHOLD *TCAT ’) SAVE(’ +
*CAT &EXOTSAVE *TCAT ’)’) TOUSR(*SYSOPR)
GOTO CMDLBL(STEP4)
AFT_FAIL:
SNDMSG MSG(’WARNING: The AFP data stream which was +
created by APU could not be printed with +
the PRTAFPDTA command. (FYI: APU used +
print definition’ *BCAT &EXPRTDLB *TCAT +
Appendix B. User Exits 109