Rob,
Can JOBLOG PENDING be saved in case they needed to be restored at a later date?
Paul
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Rob Berendt
Sent: Thursday, April 26, 2018 10:15 AM
To: Midrange Systems Technical Discussion
Subject: RE: Anyone know of a way to search all joblogs for return codes that are not ZERO
Gee if you can query a job to find it's joblog by using the service 
QSYS2.JOBLOG_INFO
then how hard would it be to pretty this up
insert into My_custom_joblog_history_table (
   select a.job_name, b.*
   from table(qsys2.active_job_info()) a,
   lateral (select * from table(qsys2.joblog_info(a.job_name)) x) b)
Or some such thing?  Just a quick shot from the hip using Kevin Adler's 
example.  Not sure if active_job_info is the one you'd want but it's a 
darn good example.
This is a LOT better than spool files.  You never have to work about a 
string you're looking for in the text spanning lines in the joblog like 
you do with spool file output.  For example
     now is the time
     for all good men
     to come to the aid
     of their country
When all that would be in one column and not on multiple rows.
Plus you have functions like UPPER, etc.
As far as your 90 days on the system, well, GO CLEANUP works the same with 
these joblogs as it does with spool file joblogs.
And you don't have to worry about the "former employee" who told his 
division to just do a CLROUTQ QEZJOBLOG on a periodic basis.
Or the people freaking out over these showing up when they do WRKSPLF and 
just start whacking them.
http://ibm.biz/DB2foriServices
And if you want to look at a combo of both spool file joblogs and these 
joblogs then look at WRKJOBLOG.  IBM has been changing several of their 
job descriptions to *PND already so you may have some of these on your 
system.
WRKJOBLOG
Job log state  . . . . . . . . .   *PENDING
                                   *SPOOLED
Time period: 
  Start time and date: 
  Beginning time . . . . . . . .   *AVAIL 
  Beginning date . . . . . . . .   *CURRENT
  End time and date: 
  Ending time  . . . . . . . . .   *AVAIL 
  Ending date  . . . . . . . . .   *CURRENT
Job name . . . . . . . . . . . .   *ALL 
  User . . . . . . . . . . . . .     *ALL 
  Number . . . . . . . . . . . .     *ALL 
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.