× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Searching joblogs is quite easy "IF" one gets over the decades old method
of insisting that joblogs go to spool files.
IBM has issued some tools a few releases back. Among them are:
- WRKSYSVAL QLOGOUTPUT Change that one to *PND
- WRKJOBD. Job log output (LOGOUTPUT). Change that to *SYSVAL 'after'
changing QLOGOUTPUT or try a few at *PND
- CHGJOB. Job log output (LOGOUTPUT). Change that to *SYSVAL 'after'
changing QLOGOUTPUT or try *PND

Then it becomes quite easy to search joblogs using the various services at
http://ibm.biz/DB2foriServices

All my lpars have QLOGOUTPUT set to *PND. If you just have to have a
spool file you can always do a DSPJOBLOG OUTPUT(*PRINT). About the only
time I ever do that is when IBM wants to look at one.

The problem with looking for return code not equal to zero is that not all
messages use the same positional parameter, etc. So you may have to fudge
it looking for text like
Select
ORDINAL_POSITION, -- A unique number for each row that indicates the
time order of messages in the job log.
MESSAGE_ID, -- The message ID for this message.
MESSAGE_TYPE, -- Type of message.
MESSAGE_SUBTYPE, -- Subtype of message.
SEVERITY, -- The severity assigned to the message.
MESSAGE_TIMESTAMP, -- The timestamp for when the message was issued.
FROM_LIBRARY, -- The library containing the program or service
program that sent the message.
FROM_PROGRAM, -- The program or service program name that sent the
message.
FROM_MODULE, -- The module that sent the message.
FROM_PROCEDURE, -- The procedure that sent the message.
FROM_INSTRUCTION, -- The instruction that sent the message.
TO_LIBRARY, -- The library containing the program or service
program that received the message
TO_PROGRAM, -- The program or service program name that received
the message.
TO_MODULE, -- The module that received the message.
TO_PROCEDURE, -- The procedure that received the message.
TO_INSTRUCTION, -- The instruction that received the message.
FROM_USER, -- The userid of the job when the message was sent.
MESSAGE_FILE, -- The message file containing the message.
MESSAGE_LIBRARY, -- The name of the library containing the message
file.
MESSAGE_TOKEN_LENGTH, -- The length of the MESSAGE_TOKENS string.
MESSAGE_TOKENS, -- The message token string. If the value is longer
than 2048 characters, it will be truncated with no warning.
MESSAGE_TEXT, -- The first level text of the message including
tokens.
MESSAGE_SECOND_LEVEL_TEXT -- The second level text of the message
including tokens.
from table(qsys2.joblog_info('*')) A
where message_text like '%eturn code%' and message_text not like '%eturn
code 0%'
order by ordinal_position asc
fetch first row only;


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.