First get a list of all objects in the library.
DSPOBJD OBJ(?Yourlib/*ALL) OBJTYPE(*ALL)
This will create a file with files that you can use to do the moves for you.
Once you determine some logic to make the decision as to where to move what,
Write a CL program to read this file and execute the logic.
Fields you would probably look at would be:
ODOBNM Object Name
ODOBTP Object type
ODOBAT Object attribute
ODOBTX Text description
You may have to use substring to look for selected values.
There may be more fields you want to use depending on your circumstances.
You can code and run your program in steps. Do the most common first, then code the more specific checks.
If this was a repeatable process and I had to use it over many libraries or machines, I would do as described above.
If this is a one shot deal, I would use WRKOBJPDM and do it manually.
Either way, you need to define the rules.
With PDM I can use F17 to get a subset of the objects in a library.
Then put ’11’ on the OPT line for the first one and do F13
I would then review the list and removed any ’11’ options for objects that I did not want to move to the specified library.
ENTER will let you put in the targe library name
ENTER and those are all done.
Change your subset with F17 and go again.
This gives you an option for visual verificatiion and saves the time for coding and TESTING you new throw away program.