1,150 pts.
 Delete objects on AS/400
Hi I have a list of objects arranged alphabetically, I want to delete these objects in that order from a iseries server, can somebody help me how to write a CL for this?

Software/Hardware used:
ibm i
ASKED: July 16, 2011  6:23 PM
UPDATED: March 31, 2012  9:15 PM

Answer Wiki:
Is this list in machine readable format? Do you also have the library name the object is in? Do you have the Obejct type? * PGM DLTxxx LLL/Onject DLTxxx LLL/Onject DLTxxx LLL/Onject .. .. ENDPGM xxx = Object type (F, PGM, etc) LLL - Library that contains the object
Last Wiki Answer Submitted:  July 18, 2011  2:22 am  by  CharlieBrowne   32,835 pts.
All Answer Wiki Contributors:  CharlieBrowne   32,835 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I have a list of objects arranged alphabetically…

CharlieBrowne’s comment works well if you have a specific list. It’s perfectly valid just to run the exact sequence of DLTxxx commands.

If the list needs to change periodically, then you probably want a program that adapts automatically to new lists.

First question is — how is the list stored? Is it in a database file? In a text file?

Then, what values are in the list? Name of object? Library of object? Type of object?

And what is your OS version/release? Newer releases have better programming options.

Tom

 108,005 pts.

 

If the file records must be processed alphabetically, you might consider using OPNQRYF to ensure the records are in the correct sequence.

 5,670 pts.

 

If the list is in a file..you have to read the file in sequence.
for 1st object,you have to do a chkobj..if exists ,you do DLTxxx command based on object type…if sucessful go to next one..till end of file.

 130 pts.