Hi Jerry -

I'm responding to this back on the list so that others can benefit from and/or contribute to the discussion.

I copied your cl (now called RMVDELREC) (many thanks BTW) from

http://www.ke9nr.net/iseries/faqs/reorgpf.shtml

and ran it this weekend on a bunch of test libraries from a mother CL.  I ran
into one that halted the process because a library did not have any *PF files
(shotgun approach).

Here's a joblog fragment from your CL:

CALL PGM(RMVDELREC) PARM('LAWPGMPKD' '*ALL')
5700 - DSPFD FILE(LAWPGMPKD/*ALL) TYPE(*MBRLIST) OUTPUT(*OUTFILE)
FILEATR(*PF) OUTFILE(QTEMP/REORGPF)
8400 - RCVMSG MSGTYPE(*ANY) RMV(*YES) MSGDTA(&MSGDTA) MSGID(&MSGID)
RTNTYPE(&RTNTYPE) MSGF(&MSGF) SNDMSGFLIB(&SNDMSGFLIB)
10800 - SNDPGMMSG MSGID(CPF3020) MSGF(QSYS/QCPFMSG) MSGDTA('*ALL
LAWPGMPKD') MSGTYPE('*ESCAPE')
No files in *ALL in LAWPGMPKD have the specified FILEATR.

It jumps from the DSPFD to the MSGLOOP to a SNDPGMMSG in your CL. This is in
line with your note 2: If an error occurs on the DSPFD command, the associated
messages sent to the calling program and no files are reorganized.


In the mother process I put a monmsg after each call to the daughter process and
it continues past the library with no *PF objects. Is this what you would
recommend?


CALL PGM(RMVDELREC) PARM('LAWDBFPKD' '*ALL')
MONMSG MSGID(CPF0000)
>
CALL PGM(RMVDELREC) PARM('LAWPGMPKD' '*ALL')
MONMSG MSGID(CPF0000)
>
CALL PGM(RMVDELREC) PARM('JDRAPER' '*ALL')
MONMSG MSGID(CPF0000)
>

If you are doing this unattended or not closely monitored, this is a good way to do it so that the process will run to completion. Just be sure that a joblog is created and check it for problems.

If you are monitoring the job, you might want here to monitor just for CPF3020 and let it halt if anything else untoward happens. Or remove the calls to libraries that don't have any physical files and not have a MONMSG at all.

If you want something really sweeping you can have the mother program do
DSPOBJD OBJ(*ALL) OBJTYPE(*LIB)
to an outfile, then read through that outfile and call RMVDELREC for each library (hard-code the mother program to skip QSYS). In this case you would definitely want MONMSG CPF3020, and probably MONMSG CPF0000.


Another option, if you have a fixed set of libraries to reorganize, is to put multiple DSPFDs in RMVDELREC, one right after the other, making sure to use OUTMBR(*FIRST *ADD) so that subsequent DSPFDs don't wipe out the output from the previous ones.

There are all sorts of ways to get creative. The short programs on my site are just to provide a starting point that can be enhanced and expanded for the individual needs of each company/organization.

--
Ken
http://www.ke9nr.net/
Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind.



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.