Additional considerations for SAVCHGOBJ

If you need to save changed objects as part of your save strategy, you must ensure that any partial save activity that occurs between your full save operations does not affect what you save with the SAVCHGOBJ command. If users occasionally save individual objects, you may want them to specify UPDHST(*NO). That prevents their save activity from having an impact on the overall SAVCHGOBJ strategy.

Note: The most common way to use the SAVCHGOBJ command is to specify REFDATE(*SAVLIB). If you have a new library that has never been saved, it is not saved when you specify SAVCHGOBJ REFDATE(*SAVLIB).

Using SAVCHGOBJ–Example:

In a typical environment, you might use the SAVLIB command once a week and the SAVCHGOBJ command every day. Because the default for SAVCHGOBJ is from the last SAVLIB operation, the media that the SAVCHGOBJ command produces tends to grow during the week.

What follows shows an example of using SAVCHGOBJ during a typical week. Assume that you save the entire library on Sunday night and the SAVCHGOBJ command is used each evening during the week:

Table 1. SAVCHGOBJ Command: Cumulative
Day Files That Changed That Day Media Contents
Monday FILEA, FILED FILEA, FILED
Tuesday FILEC FILEA, FILEC, FILED
Wednesday FILEA, FILEF FILEA, FILEC, FILED, FILEF
Thursday FILEF FILEA, FILEC, FILED, FILEF
Friday FILEB FILEA, FILEB, FILEC, FILED, FILEF

If a failure occurred on Thursday morning, you would:

  1. Restore the library from Sunday evening.
  2. Restore all the objects from Wednesday's SAVCHGOBJ media volumes.

When you use this technique of saving everything that changed since the last SAVLIB, recovery is easier. You need to restore only the media volumes from the most recent SAVCHGOBJ operation.

Changing the reference date and time: The default for the command is to save objects that have changed since the library was last saved using the SAVLIB command. You can specify a different reference date and time by using the reference date (REFDATE) and reference time (REFTIME) parameters on the SAVCHGOBJ command. This allows you to save only objects that have changed since the last SAVCHGOBJ operation.

This may reduce the amount of media and the time for the save operation. Here is an example:

Table 2. SAVCHGOBJ Command–Not Cumulative
Day Files That Changed That Day Media Contents
Monday FILEA, FILED FILEA, FILED
Tuesday FILEC FILEC
Wednesday FILEA, FILEF FILEA, FILEF
Thursday FILEF FILEF
Friday FILEB FILEB

You can restore the SAVCHGOBJ media from earliest to latest. Or you can display each media volume and restore only the latest version of each object.