4.7.4 JSMADMEXT
The JSMADMIN program calls CL program JSMADMEXT when the following life cycle events occur:
ENTRY |
Program starts. |
EXIT |
Program finishes successfully. |
ERRnnnn |
where nnnn is a 4 digit number starting from 4000. |
The source code for this exit program is stored in QCLSRC in the JSM library.
/* JSMADMIN EXIT PROGRAM */
PGM PARM(&EVENT &SERVICE &SERVERHOST &REMOTEUSER &REMOTEADDR &CONTINUE &MESSAGE)
DCL VAR(&EVENT) TYPE(*CHAR) LEN(10)
DCL VAR(&SERVICE) TYPE(*CHAR) LEN(30)
DCL VAR(&SERVERHOST) TYPE(*CHAR) LEN(80)
DCL VAR(&REMOTEUSER) TYPE(*CHAR) LEN(30)
DCL VAR(&REMOTEADDR) TYPE(*CHAR) LEN(45)
DCL VAR(&CONTINUE) TYPE(*CHAR) LEN(1)
DCL VAR(&MESSAGE) TYPE(*CHAR) LEN(256)
MONMSG MSGID(CPF0000)
IF COND(%SUBSTRING(&EVENT 1 3) *EQ 'ERR') THEN(DO)
/* LOG ERROR EVENT */
SNDPGMMSG MSG('------- JSMADMIN ERROR -------')
SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&EVENT)
SNDPGMMSG MSGID(&EVENT) MSGF(JSMMSGF)
SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&SERVICE)
SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&SERVERHOST)
SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&REMOTEUSER)
SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&REMOTEADDR)
SNDPGMMSG MSG('------------------------------')
GOTO END
ENDDO
IF COND(&EVENT *EQ 'ENTRY') THEN(DO)
/* DEFAULT VALUE FOR CONTINUE IS 'Y' */
/* CHGVAR VAR(&CONTINUE) VALUE('N') */
/* CHGVAR VAR(&MESSAGE) VALUE('I do not know you') */
GOTO END
ENDDO
IF COND(&EVENT *EQ 'EXIT') THEN(DO)
GOTO END
ENDDO
END: ENDPGM