× 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.



Cross posted to midrange-l

Michael Quigley
Computer Services
The Way International
www.TheWay.org

"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 04/17/2017 05:45:44
PM:

----- Message from Danny Hayes <Danny_Hayes@xxxxxxxxx> on Mon, 17
Apr 2017 21:45:29 +0000 -----

To:

"RPG programming on the IBM i (AS/400 and iSeries)"
<rpg400-l@xxxxxxxxxxxx>

Subject:

RE: Joblogs for jobs in jobq: Not sure this is the right group, but
if not I am sure Mr Gibbs will point me to the right one.

Roger,

So you are suggesting I do this for 232,000 jobs? Or do you have
some way to get all 232,000 jobs to spool other than by manually
entering each individual job in the job queue?


Danny,

I've done something very similar--albeit not over quite as many entries.

If the jobs have a common name, you can do a DSPJOBLOG {commonname}. This
will send a bunch of diagnostic messages containing the unique job name.
The diagnostic messages are followed by a single CPF1069 escape message.
Then you can walk your way back through the diagnostic messages and use
Roger's suggestion on each one. (This won't be a regular speed demon, but
it will beat trying to manually look through the jobs to determine the
correct one. I'm certain faster processing is available with the QMHLJOBL
API, but I've never used actually it.)

Here's a skeleton (not tested) of the basic loop. You may need to do a
MONMSG MSGID(CPF2415) in case you don't find the job in all the messages.


/*--------------------------------------*/
dcl var(&MSGKEY) type(*CHAR) len(4)
dcl var(&MSGDTA) type(*CHAR) len(26)
dcl var(&JOBNAM) type(*CHAR) len(10) stg(*defined) devvar(&MsgDta 1)
dcl var(&JOBUSR) type(*CHAR) len(10) stg(*defined) devvar(&MsgDta 11)
dcl var(&JOBNBR) type(*CHAR) len(6) stg(*defined) devvar(&MsgDta 21)

dcl var(&True) type(*LGL) value('1')

DspJobLog {commonname}
monmsg msgid(CPF1069)
rcvmsg msgtype(*LAST) keyvar(&MSGKEY)

dowhile &True
rcvmsg msgtype(*PREV) msgkey(&MSGKEY) keyvar(&MSGKEY) msgdta(&MSGDTA)
/* We now have unique job identification for a job */
/* Do the DSPJOBLOG and get it to a PF, etc where you can read it */

/* When your testing finds the right job */
if cond(&foundit) then(leave)
/* You can specify a command label on LEAVE to leave a specific loop */

enddo

/*--------------------------------------*/

I'm sure the API would run faster. It depends on how comfortable you are
working with APIs.

Also, you probably ought to test the message ID to make sure you're
getting CPF0906 You may also need to your job log size to allow 233,587
diagnostic messages.


Thanks,
Danny

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Roger Harman
Sent: Monday, April 17, 2017 5:09 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
<rpg400-l@xxxxxxxxxxxx>
Subject: Re: Joblogs for jobs in jobq: Not sure this is the right
group, but if not I am sure Mr Gibbs will point me to the right one.

Not fully tested.....

I didn't see a DB2 service for job queue entries, but you can
display it to *print.

Copy the spool file to a PF
Use the PF as a CTE (picking out the job info) for this DB2 service:
TABLE(QSYS2.JOBLOG_INFO(<job name>')) where MESSA00008 like '%<your
parm here>%'

A little brute force but it should work.

Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power








From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxx> on behalf of Danny
Hayes <Danny_Hayes@xxxxxxxxx>
Sent: Monday, April 17, 2017 1:16 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Joblogs for jobs in jobq: Not sure this is the right group,
but if not I am sure Mr Gibbs will point me to the right one.

I have an issue I thought one of you might have a solution for:

I have a job queue with 233,587 entries in it, all from me, it is on
hold.
Each job has in its joblog the name of an order of some type.
I only want to run the job that has the one I care about, but it
would take me a couple of days to display each job and check its
joblog to see if it is the one.
I need some way to dump all of the joblogs into one bucket and then
search all for the one I want.

each joblog looks like this: CALL PGM(*LIBL/ASN0220CL) PARM
('ALB170401ALB053O0000' ' 0508000')

I want to find the one job that has ATL170408ATL050N0000 as the
parameter.

Do you know of any method to accomplish this?

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.