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



Or modify the CL program, below. Some commands require a good F4; the GRTOBJAUT will need customization.

I've used this basic structure countless times when I have to loop past all objects in a library, or all objects of a certain type. (I have the file name memorized!).

Declaring the file using IBM's name-- QADSPOBJ-- lets you use the empty, memberless file in QSYS for your compile-- no need to create a file by hand before compiling the program. The OVRDBF makes sure your program is reading from the file you just created.

The GRTOBJAUT command uses the field names from the QADSPOBJ file. They're defined automatically during the compile. I use the &ODLBNM instead of the name "yourlib" because most of the time I use this program I'm grabbing data from multiple libraries to the file in QTEMP, and the library name is not a constant.

I usually pass the library name as a parameter. You may need to add some validation of the library name before you use it (CHKOBJ). If the library is a hotbed of activity, you may need a monitor message after the GRTOBJAUT in case the object that was just there a few minutes ago has suddenly disappeared. (:

--Paul E Musselman
PaulMmn@ix.netcom.nospam.com



PGM

DCLF QADSPOBJ

DSPOBJD yourlib/*ALL OBJTYPE(*ALL) DETAIL(*SERVICE)
OUTPUT(*OUTFILE) OUTFILE(QTEMP/QADSPOBJ)

OVRDBF QADSPOBJ QTEMP/QADSPOBJ

LOOP:

RCVF
MONMSG CPF0864 EXEC(GOTO QUIT)

GRTOBJAUT OBJECT(&ODLBNM/&ODOBNM) etc. etc.

GOTO LOOP


QUIT: ENDPGM


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.