Playing with Save Files

We have recently posted about a new utility which would allow objects to be restored from a save file based on a number of generic parameters in response to a request on a code forum. We built the utility and did some initial testing which did what we expected with one slight drawback, the Extended attributes stored in the save file for the objects are not complete. The problem arose because a user wanted to be able to restore objects based on their extended attributes such as PF-DTA or PF-SRC, unfortunately IBM only stores a part of the extended attributes (PF in this case) so while the utility does work it is not suitable for this clients requirements. We have submitted a change request into IBM but we doubt if it will get much attention.

That drove us to look at other options around the save file content, the first problem we came across is the ability to use the QSRLSAVF API for displaying the content of a save file which is from the IFS. Again we have submitted a change request into IBM to ask if it would be possible to update the API to allow the listing of the content when it is a save of the IFS (The DSPSAVF will display partial paths etc but it is simply not useful in the kind of utilities we are building), again we are not hopeful on IBM giving it much attention.

Having come against these road blocks we still went forward with a couple of other utilities which we feel would be useful in lots of IBMi shops.

The ability to list a save file and select objects to restore seemed to be a good starting point. The same API could be used to list the SAVF content to a panel group and we would provide the option of selecting objects from the list to be restored. The output is designed to look pretty much like the DSPSAVF command displays only we added the option to restore the objects, F16 will show the SAVF information in the same manner the DSPSAVF does. Again we noticed some information is missing from the API output which is shown in the DSPSAVF command, but it was not significant enough to cause any concerns or need another change request into IBM.

Here is a sample of the output, we also added the ability to add parameters to the command line which allows things like the RSTLIB parameter to be changed etc.

Save file content with option to restore

Another idea we had was to be able to save selected objects from a library to a save file, we had built this previously for a client and added to our HA4i product, we migrated the objects and source to the new utilities product and linked it up with the menus etc. It allows a library to be listed and objects to be individually flagged to save, when you have selected all the objects you are interested in pressing enter will create/clear the save file and save all of the flagged objects to the save file of your choice.

Here are a couple of screen samples to show the process.

SAVSLTOBJ Command prompt

Shows objects flagged for saving
Selected objects to be saved

Resulting save file
Display of the save file with the objects selected having been saved
The utilities will be packaged as a LPP in the near future ready for customer trials and use. If you are interested in anything we have developed or have ideas about other utilities let us know.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.