Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
I asked this same questions but a different way a few weeks ago.
What I want to do is save source file members on one system and restore those source files members to an existing source file on another system WITHOUT REPLACING the target source file (i.e., do not delete all the existing members). Any ideas?
Sounds like you want MBROPT(*NEW); this only restores members in the save that do not currently exist in the file. If you want to replace existing members, that's *OLD. If you want *NEW and *OLD, that's *ALL. *MATCH, however, means it only restores, and overlays, if the list of members is identical between the save and the *FILE.
You'll also need ALWOBJDIF() for file level and owner. If you don't tell it to ignore those, and there are object level differences, it doesn't restore (which might be a good thing). If you use ALWOBJDIF(*ALL), and there are object level differences, that's when restore renames the existing file to *000n, and creates new object with what's restored (which is usually a pain in the neck, but at least you still have everything).
Might want to save the restore-to object to a save file or something, so you can reset it if you don't like the results after your restore.
Dale, you're right, what I want is at the member-level the ability to restore in the same way we can at the object level. If I restore a member to QRPGLESRC, I don't want to replace the QRPGLESRC file entirely and end up with just the one member--that's just incredibly stupid and careless design. If I restore one object to a library, it doesn't delete all the other objects--imaging if it did.
If I change one member and create a new one, I'm screwed there too.
We do development on one system and push those changes out to 7 to 10 other systems and this is constantly giving us problems.
I think what I am going to do is this:
That is the only way it will actually do what I want. If I'm missing something let me know.
Your process is very similar to what I do with certain libraries for refreshing test data from production saves. I'm not sure about restore to QTEMP, though; you might need to create a real library. I use RST* for restore-to temporary holding place libraries, but of course your naming might not work with that. Before restoring, part of my process includes the step "Clear the RSTxx library", which removes the need for ALWOBJDIF. You might want to use a member list on either the save or the restore, to keep the size down.