• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Admin Alert: Creating a Save Changed Objects

    March 9, 2005 Joe Hertvik


    Backup Tape

    Like most operating systems, OS/400 provides a save changed objects function, allowing you to selectively backup only those objects that have changed since the last full system backup. This week, I’ll examine the save changed objects procedure and give you some simple CL code for creating a saved objects backup tape. A save changed object backup works in conjunction with a full system backup to minimize weekly backup times and to enable administrators to restore objects from several different tapes in a backup cycle.

    The two backups work together in the following way:

    • The full system or Save While Active backup creates a baseline portrait of your system that contains all user and system objects. It takes longer to backup a system this way, so this backup is generally run once a week when system usage is at its lowest.
    • The save changed objects backup can be run on a regular basis to save only those objects that have been changed since the last full system backup. This type of backup runs faster–since there are far fewer files–and that means you can run it nightly and you can save changed objects while they are active.

    When you need to restore objects to the system, you can restore them from either the full system backup tape or the save changed object tape or both, depending on which tape contains the version of the objects you want to restore. For libraries, you could restore the library from both tapes, overlaying the full backup with any newer objects from the save changed object tape. The result is that you have up-to-date backup coverage of all your user objects, without extending the time and resources it would take to back up every object every night.

    Save changed object backups are also valuable when you’re migrating data from one AS/400, iSeries, or i5 partition to another. In a migration scenario, you may be staging and testing a new partition while you are still doing production work on an older partition on another machine. Using a save changed object tape in conjunction with a full backup, you can restore the entire system from the full backup tape, and then make the new box current at any time by only restoring those objects that have changed since the last full backup. A save changed object tape is also helpful in maintaining an independent test environment, where you periodically need to refresh your data with new information without having to reload the entire system.

    To create a save changed objects tape that can be used to restore most user objects on an OS/400 system, I created the following code. With this code, you can create a tape that saves every user-based changed object that you might want to restore to a target system:

    SAVSECDTA  DEV(tape_drive_name) ENDOPT(*LEAVE)    
    MONMSG     MSGID(CPF0000)         
    SAVCHGOBJ  OBJ(*ALL) LIB(*ALLUSR) DEV(tape_drive_name) +
                 OBJJRN(*YES) REFDATE(*SAVLIB) +    
                 ACCPTH(*YES) OUTPUT(*PRINT)        
    MONMSG     MSGID(CPF0000)
    SAVDLO     DLO(*SEARCH) DEV(tape_drive_name) SRCHTYPE(*ALL) +
                 OWNER(*ALL) REFCHGDATE(*SAVDLOALL)      
    MONMSG     MSGID(CPF0000)         
    SAV        DEV(/QSYS.LIB/tape_drive_name.DEVD) OBJ(('/*' *INCLUDE) +     
                 ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT)) +  
                 OUTPUT(*PRINT) ENDOPT(*LEAVE) +         
                 CHGPERIOD(*LASTSAVE)                                 
    

    Except for the Save Security Data (SAVSECDTA) command, all these commands can also be run in Save While Active mode. Here’s how it all fits together.

    The SAVSECDATA command saves all user profiles that you may need to restore to your target system. There is nothing different about this command that you wouldn’t see in a regular full system or Save While Active backup, but you can use this function to keep your security data current.

    As shown here, the Save Changed Objects command (SAVCHGOBJ) saves all the changed objects in your machine’s user libraries (all libraries whose names do not begin with the letter ‘Q’) as designated by *ALLUSR literal in the Library parameter (LIB). By designating *SAVLIB in the Reference Date parameter (REFDATE), OS/400 only saves those objects that have changed in your libraries since the last time a SAVLIB command was run over each library.

    If you want to modify this SAVCHGOBJ command to only backup objects that have changed since a certain date and time, you could change the command to look like this:

    SAVCHGOBJ  OBJ(*ALL) LIB(*ALLUSR) DEV(tape_drive_name) +   
                  OBJJRN(*YES) REFDATE('mm/dd/yy') +    
                  REFTIME('hh:mm:ss') ACCPTH(*YES) +    
                  OUTPUT(*PRINT)
    

    Running the command this way only saves those objects that were changed after the date and time specified in the Reference Date and Reference Time parameters (REFDATE and REFTIME, respectively). This variation is handy when you are trying to synchronize data between two environments, where the synchronizing partition was originally restored from a full system backup and you want to create a tape to port newer object changes between the two environments.

    The Save Document Library Object command (SAVDLO) performs the same function for Document Library Objects (DLOs) as the SAVCHGOBJ command does for OS/400 library objects. In this configuration, SAVDLO will only save DLO folder and document objects that have been created since the last time the SAVDLO command was run, as specified by the *SAVDLOALL value in the Last Changed Date parameter (REFCHGDATE). Note that you can only save changed DLOs when the DLO parameter (DLO) is equal to *SEARCH.


    Like the SAVCHGOBJ command, you can also tell the SAVDLO command to only save files that have been saved since a certain date and time by entering the starting date and time in the Last Changed Date (REFCHGDATE) and the Last Changed Time (REFCHGTIME) parameters.

    The Save command (SAV) saves all the IFS objects that have changed since the last time the SAV command was run with the Update History parameter (UPDHST) set to *YES. (This is specified by setting the time period for last change parameter, CHGPERIOD, to *LASTSAVE in the code above). Like the other commands, the CHGPERIOD parameter can also be set to save IFS objects that were modified after a specific date and time.

    With these commands, you can create a save changed objects tape that contains all the non-IBM objects that you might need to restore changed files to your current system or to a system in another environment. But just remember that this tape has to work in conjunction with a recent system backup or it will not be as helpful to your shop.

    Click here to contact Joe Hertvik by e-mail.

    Share this:

    • Share on Reddit (Opens in new window) Reddit
    • Share on Facebook (Opens in new window) Facebook
    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Email a link to a friend (Opens in new window) Email

    Tags:

    Sponsored by
    FalconStor

    Simplify Secure Offsite Data Protection for IBM Power with FalconStor Habanero™

    IBM i teams are under growing pressure to ensure data is protected, recoverable, and compliant—without adding complexity or disrupting stable environments.

    FalconStor Habanero™ provides secure, fully managed offsite data protection purpose-built for IBM Power. It integrates directly with existing IBM i backup tools and processes, enabling reliable offsite copies without new infrastructure, workflow changes, or added operational overhead.

    By delivering and managing the service end-to-end, FalconStor helps organizations strengthen cyber resilience, improve disaster recovery readiness, and meet compliance requirements with confidence. Offsite copies are securely maintained and available when needed, supporting recovery, audits, and business continuity.

    FalconStor Habanero offers a straightforward way to modernize offsite data protection for IBM i: focused on simplicity, reliability, and resilience.

    Learn More

    Share this:

    • Share on Reddit (Opens in new window) Reddit
    • Share on Facebook (Opens in new window) Facebook
    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Email a link to a friend (Opens in new window) Email

    PC5250 and the Print Key LANSA Unveils 2005 Version of IDE

    Leave a ReplyCancel reply

Volume 5, Number 10 -- March 9, 2005
THIS ISSUE
SPONSORED BY:

T.L. Ashford
Patrick Townsend & Associates
COMMON

Table of Contents

  • Recursion and the Alternatives
  • PC5250 and the Print Key
  • Admin Alert: Creating a Save Changed Objects

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Bob Code Assistant Gets Better Understanding Of IBM i Applications
  • IBM i In The Cloud And The Case For Reversing Replication
  • Guru: From Hiking Boots To Long-Term Memory
  • Inside IBM’s New PowerHA Cloud Offering, Full System Manager
  • IBM i PTF Guide, Volume 28, Number 39
  • Power Systems Turns In Another Great Quarter
  • Big Blue Is Right On Schedule With Fall 2026 IBM i Tech Refreshes
  • Guru: Environment Variables – Global Variables Wearing Hiking Boots
  • A New IBM i Entity Takes Shape: Power By Fortra
  • IBM i PTF Guide, Volume 28, Number 38

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle