Example: Controlling information written in a job log
This example shows how the logging level affects the information that is stored in the job message queue and, therefore, written to the job log, if one is requested.
- The CHGJOB command specifies a logging level of 2 and a message severity
of 50, and that only messages are to be written to the job log (*MSG).
Command Entry SYSTEM1 Request level: 1 Previous commands and messages: > CHGJOB LOG(2 50 *MSG)
- PGMA sends three informational messages with severity codes of 20, 50,
and 60 to its own call message queue and to the caller or the previous call
message queue, for example, *PRV, which would be QCMD in this example using
the command entry display. The messages that PGMA sends to its own call message
queue are called detailed messages. Detailed messages are those messages
that are sent to the call message queue of the lower-level program call.
PGMB sends two informational messages with severity codes of 40 and 50 to its own call message queue. These are detailed messages. PGMB also sends one informational message with a severity code of 10 to *PRV, which is a high-level message.
Note in the following display, after PGMA and PGMB are called, that the CHGJOB command no longer appears on the display. According to logging level 2, only requests for which a high-level message has been issued with a severity equal to or greater than that specified are saved for the job log, and no messages were issued for this request. CHGJOB was removed, or filtered from the job log, when the next request CALL PGMA was received. When a new request is received, the previous request is filtered according to the log level. If such a high-level message had been issued, any detailed messages that had been issued would be saved for the job log and could be displayed by pressing F10.
Command Entry SYSTEM1 Request level: 1 Previous commands and messages: > CALL PGMA Message sev 20 - PGMA Message sev 50 - PGMA Message sev 60 - PGMA > CALL PGMB Message sev 10 - PGMB Bottom Type command, press Enter. ===> _________________________________________________________________________ ______________________________________________________________________________ ______________________________________________________________________________ _____________________________________________________________________________ F3=Exit F4=Prompt F9=Retrieve F10=Include detailed messages F11=Display full F12=Cancel F13=Information Assistant F24=More keys
Request CALL PGMA results in a high-level message equal to or greater than the current log severity, so when request CALL PGMB is entered, no messages from PGMA are filtered.
- When F10=Include detailed messages is pressed from the Command Entry display,
all the messages associated with the request CALL PGMA are displayed. All
messages for request CALL PGMB are also shown because no filtering for the
request has occurred yet.
Command Entry SYSTEM1 Request level: 1 All previous commands and messages: > CALL PGMA Detailed message sev 20 - PGMA Detailed message sev 50 - PGMA Detailed message sev 60 - PGMA Message sev 20 - PGMA Message sev 50 - PGMA Message sev 60 - PGMA > CALL PGMB Detailed message sev 40 - PGMB Detailed message sev 50 - PGMB Message sev 10 - PGMB Bottom Type command, press Enter. ===> _________________________________________________________________________ ______________________________________________________________________________ ______________________________________________________________________________ _____________________________________________________________________________ F3=Exit F4=Prompt F9=Retrieve F10=Exclude detailed messages F11=Display full F12=Cancel F13=Information Assistant F24=More Keys
- When another command is entered (in this example, another CHGJOB), the
CALL PGMB
command and all messages (including detailed messages) are removed. They are removed because the severity code for the high-level message associated with this request was not equal to or greater than the severity code specified in the CHGJOB command. TheCALL PGMA
command and its associated messages remain because at least one of the high-level messages issued for that request has a severity code equal to or greater than that specified. Press F10 again to exclude detailed messages.On the following display, the CHGJOB command specifies a logging level of 3, a message severity of 40, and that both the first- and second-level text of a message are to be written to the job log. When another command is entered, the CHGJOB command remains on the display because logging level 3 logs all requests.
PGMC sends two messages with severity codes of 30 and 40 to the call message queue of its caller (*PRV).
PGMD sends a message with a severity of 10 to *PRV.
Command Entry SYSTEM1 Request level: 1 Previous commands and messages: > CALL PGMA Message sev 20 - PGMA Message sev 50 - PGMA Message sev 60 - PGMA > CHGJOB LOG(3 40 *SECLVL) > CALL PGMC Message sev 30 - PGMC Message sev 40 - PGMC > CALL PGMD Message sev 10 - PGMD Bottom Type command, press Enter. ===> _________________________________________________________________________ ______________________________________________________________________________ ______________________________________________________________________________ _____________________________________________________________________________ F3=Exit F4=Prompt F9=Retrieve F10=Include detailed messages F11=Display full F12=Cancel F13=Information Assistant F24=More Keys
- When another command (CALL PGME) is entered after the
CALL PGMD
command was entered, theCALL PGMD
command remains on the display, but its associated message is deleted. The message is deleted (filtered from the job log) because its severity code is not equal to or greater than the severity code specified on the LOG parameter of the CHGJOB command.The command
SIGNOFF *LIST
is entered to end the job and print the job log.Command Entry SYSTEM1 Request level: 1 Previous commands and messages: > CHGJOB LOG(3 40 *SECLVL) > CALL PGMC Message sev 30 - PGMC Message sev 40 - PGMC > CALL PGMD > CALL PGME Bottom Type command, press Enter. ===> SIGNOFF *LIST____________________________________________________________ ______________________________________________________________________________ ______________________________________________________________________________ _____________________________________________________________________________ F3=Exit F4=Prompt F9=Retrieve F10=Include detailed messages F11=Display full F12=Cancel F13=Information assistant F24=More Keys
The job log, which follows, contains all the requests and all the messages that have remained on the Command Entry display. In addition, the job log contains the message help associated with each message, as specified by the last CHGJOB command. Notice that the job log contains the message help of any message issued during the job, not just for the messages issued since the second CHGJOB command was entered.
5770SS1 V7R1M0 100416 Job Log SYSAS727 01/16/11 07:13:35 Page 1
Job name . . . . . . . . . . : QPADEV000C User . . . . . . : JOHNDOE Number . . . . . . . . . . . : 038518
Job description . . . . . . : QDFTJOBD Library . . . . . : QGPL
MSGID TYPE SEV DATE TIME FROM PGM LIBRARY INST TO PGM LIBRARY INST
CPF1124 Information 00 01/16/11 07:13:19.570504 QWTPIIPP QSYS 0613 *EXT *N
Message . . . . : Job 038518/JOHNDOE/QPADEV000C started on 01/16/11 at
07:13:19 in subsystem QINTER in QSYS. Job entered system on 01/16/11 at
07:13:19.
*NONE Request 01/16/11 07:13:24.318144 QMHGSD QSYS 0010 QCMD QSYS 0178
Message . . . . : -CALL PGMA
MSG1001 Information 20 01/16/11 07:13:24.361064 PGMA JOHNDOE 0029 PGMA JOHNDOE 0029
From User . . . . . . . . . : MARYJANE
Message . . . . : Detailed message sev 20 - PGMA
MSG1001 second level text - PGMA
MSG1002 Information 50 01/16/11 07:13:24.361416 PGMA JOHNDOE 0032 PGMA JOHNDOE 0032
Message . . . . : Detailed message sev 50 - PGMA
MSG1002 second level text - PGMA
MSG1003 Information 60 01/16/11 07:13:24.361592 PGMA JOHNDOE 0036 PGMA JOHNDOE 0036
Message . . . . : Detailed message sev 60 - PGMA
MSG1003 second level text - PGMA
MSG1004 Information 20 01/16/11 07:13:24.361776 PGMA JOHNDOE 003A QCMD QSYS 01A6
Message . . . . : Message sev 20 - PGMA
MSG1004 second level text - PGMA
MSG1005 Information 50 01/16/11 07:13:24.362192 PGMA JOHNDOE 0043 QCMD QSYS 01A6
From User . . . . . . . . . : MARYJANE
Message . . . . : Message sev 50 - PGMA
MSG1005 second level text - PGMA
MSG1006 Information 60 01/16/11 07:13:24.362552 PGMA JOHNDOE 004C QCMD QSYS 01A6
Message . . . . : Message sev 60 - PGMA
MSG1006 second level text - PGMA
*NONE Request 01/16/11 07:13:24.370240 QMHGSD QSYS 0018 QCMD QSYS 0178
Message . . . . : -CHGJOB LOG(3 40 *SECLVL)
*NONE Request 01/16/11 07:13:24.370672 QMHGSD QSYS 001C QCMD QSYS 0178
Message . . . . : -CALL PGMC
MSG100F Information 30 01/16/11 07:13:24.379256 PGMC JOHNDOE *STMT QCMD QSYS 01A6
From User . . . . . . . . . : MARYJANE
From module . . . . . . . . : PGMC
From procedure . . . . . . : PGMC
Statement . . . . . . . . . : 8000
Message . . . . : Message sev 30 - PGMC
MSG100F second level text - PGMC
MSG1010 Information 40 01/16/11 07:13:24.379608 PGMC JOHNDOE *STMT QCMD QSYS 01A6
From module . . . . . . . . : PGMC
From procedure . . . . . . : PGMC
Statement . . . . . . . . . : 8200
5770SS1 V7R1M0 100416 Job Log LPAR3TLM 01/16/11 07:13:35 Page 2
Job name . . . . . . . . . . : QPADEV000C User . . . . . . : JOHNDOE Number . . . . . . . . . . . : 038518
Job description . . . . . . : QDFTJOBD Library . . . . . : QGPL
MSGID TYPE SEV DATE TIME FROM PGM LIBRARY INST TO PGM LIBRARY INST
Message . . . . : Message sev 40 - PGMD
MSG1010 second level text - PGMC
*NONE Request 01/16/11 07:13:24.379928 QMHGSD QSYS 0020 QCMD QSYS 0178
Message . . . . : -CALL PGMD
*NONE Request 01/16/11 07:13:24.383568 QMHGSD QSYS 0024 QCMD QSYS 0178
Message . . . . : -CALL PGME
*NONE Request 01/16/11 07:13:35.166408 QMHGSD QSYS 073E QCMD QSYS 0178
Message . . . . : -signoff *list
CPF1164 Completion 00 01/16/11 07:13:35.173496 QWTMCEOJ QSYS 00BD *EXT *N
Message . . . . : Job 038518/JOHNDOE/QPADEV000C ended on 01/16/11 at
07:13:35; 1 seconds used; end code 0 .
Cause . . . . . : Job 038518/JOHNDOE/QPADEV000C completed on 01/16/11 at
07:13:35 after it used 1 seconds processing unit time. The job had ending
code 0. The job ended after 1 routing steps with a secondary ending code of
0. The job ending codes and their meanings are as follows: 0 - The job
completed normally. 10 - The job completed normally during controlled ending
or controlled subsystem ending. 20 - The job exceeded end severity (ENDSEV
job attribute). 30 - The job ended abnormally. 40 - The job ended before
becoming active. 50 - The job ended while the job was active. 60 - The
subsystem ended abnormally while the job was active. 70 - The system ended
abnormally while the job was active. 80 - The job ended (ENDJOBABN command).
90 - The job was forced to end after the time limit ended (ENDJOBABN
command). Recovery . . . : For more information, see the Work Management
topic in the Information Center, http://www.iseries.ibm.com/infocenter.
The headings at the top of each page of the printed job log identify the job to which the job log applies and the characteristics of each entry:
- The product ID, version, and date of the operating system
- The system name
- The date and time the job log was printed.
- The fully qualified name of the job (job name, user name, and job number).
- The name of the job description used to start the job.
- The section number. This is printed if the job log is printed in multiple sections because the job log wrapped and *PRTWRAP was specified for the job message queue full action.
- Headings for the information in the first line of each message entry.
The following information is printed for each message entry in the job log:
- The first line for each message contains the following information:
- The message identifier or *NONE.
- The message type.
- The message severity. This is blank for request messages.
- The date and time each message was sent.
- The program name, library name, and instruction number of the program that sent the message.
- The program name, library name, and instruction number of the program to which the message was sent. *EXT indicates that the message was sent to the external message queue of the job.
- If the message was sent by a user other than the user identified as the
user in the qualified job name, the name of the user that sent the message
is printed on a separate line. This can indicate one of the following situations:
- The message was sent while the job was running under a different user profile. In the previous sample job log , messages MSG1001, MSG1005, and MSG100F were sent while the job was running under a different user profile.
- An inquiry message was replied to by another user.
- A batch job was submitted by a user other than the user profile that the batch job runs under. In this case the name of the submitting user is included for each request message.
- Another user changed the job attributes and auditing was not active so a message was sent to the job to notify it of the change by another user.
- If the sender is an Integrated Language Environment® (ILE) procedure, additional lines are printed to identify the module, procedure, and statement number. In the previous sample job log, for message MSG100F, PGMC is an ILE program.
- If the job is a multithreaded job, and messages were sent from more than one thread, the thread identifier is printed for each message.
- The message is printed on one or more lines.
- If the logging level indicates that the second-level text is to be included, the second level text appears on subsequent lines following the message.