Interactive job logs

The IBM-supplied job descriptions QCTL, QINTER, and QPGMR all have a log level of LOG(4 0 *NOLIST); therefore all messages help text are written to the job log. However, the job logs are not printed if the job ends normally unless you specify *LIST on the SIGNOFF command.

If a display station user uses and IBM-supplied menu or the command entry display, all error messages are displayed. If the display station user uses a user-written initial program, any unmonitored message causes the initial program to end and a job log to be produced. However, if the initial program monitors for messages, it receives control when a message is received. In this case, it is important to ensure that the job log is produced so that you can determine the specific error that occurred.

For example, assume that the initial program displays a menu that includes a signoff option, which defaults to *NOLIST. The initial program monitors for all exceptions and includes a Change Variable (CHGVAR) command that changes the signoff option to *LIST if an exception occurs:
PGM
DCLF MENU
DCL &SIGNOFFDPT TYPE(*CHAR) LEN(7)
VALUE(*NOLIST)
.
.
.
MONMSG MSG(CPF0000) EXEC(GOTO ERROR)
PROMPT: SNDRCVF RCDFMT(PROMPT)
CHGVAR &IN41 '0'
.
.
.
IF (&OPTION *EQ '90') SIGNOFF
LOG(&SIGNOFFOPT);
.
.
.
GOTO PROMPT
ERROR: CHGVAR&SIGNOFFOPT '*LIST'
CHGVAR &IN41 '1'
GOTO PROMPT
ENDPGM

If an exception occurs, the CHGVAR command changes the option on the SIGNOFF command to *LIST and sets on an indicator. This indicator can be used to condition a constant that displays a message explaining that an unexpected error occurred and telling the display station user what to do.

Related concepts
Start of changeHow job logs are createdEnd of change
Start of changeJob log pendingEnd of change
Job log server
Job log characteristics
QHST History Log
Spooled files