Hi guys,
I need to copy all the objects(both DB file and PGM) from a library to another library except the source file(PF-SRC). I tried DSPFD FILE([file library]/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) OUTFILE([outfile library]/[outfile]) then selecting those records where ATDTAT = ‘S’. But the outfile consists of only DB files. But I need RPGLE/CLLE program names also. Is there any command or steps to copy objects of a library excluding their source file ?
But the outfile consists of only DB files.
Then there are no source files in that library. (Or you don't have sufficient authority.)
That's not unusual. The source files usually should be in a different library.
But i need rpgle/clle program names also.
Since programs aren't files, you won't get a list of program names by requesting a list of files descriptions. You'll only get a list of file descriptions. If you want a list of program names, use the DSPOBJD command with OBJTYPE(*PGM) specified. Specify OBJTYPE(*PGM *FILE) to get a list of programs plus files.
One snag with DSPOBJD is that it doesn't show a difference between data files and source files. You could use your DSPFD command to have a list of files that identifies any that are source files. A SQL DELETE statement can then delete all records from your list of objects that match records in your list of files that are source files.
Actually, I would probably go in a different direction. I would simply use CPYLIB to copy the whole library, and then I'd delete any source files that made it into the new library.
Is there any command or steps to copy objects of a library excluding their source file ?
No command that I'm aware of. One could be created reasonably easily, but there's not enough widespread demand to have one generally available. (I've never heard of anyone wanting such a function before.) The steps would be based on the commands I mentioned above.
Tom
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 1  Reply