IBM i Global

 View Only

 save 21 with CL program and transfer job

Miguel Peralta's profile image
Miguel Peralta posted Wed September 24, 2025 03:01 PM

Hi, I remember there was a trick to perform an unattended option 21 using a CL program and a job transfer, but I can't find it anymore. I also don't remember if the job transfer was part of the program itself or if it had to be executed separately.  Best regards.

Scott Schollenberger's profile image
Scott Schollenberger

IBM provides the QMNSAVE program that is run from GO SAVE #21; that program allows RTVCLSRC (just like the QSTRUP).  So you could modify that CLP source to include a TFRJOB command that would move the job into the QCTL jobq (for example) to run in the controlling subsystem QCTL.  You will have to provide parameters to the QMNSAVE program that normally would come from the menu prompting program first.  You can review the retrieved CLP source to understand them.

Scott Schollenberger's profile image
Scott Schollenberger

Remember you can also just do the TFRJOB from your emulation session to move it into the controlling subsystem and then use the 

Start time . . . . . . . . . .   *CURRENT     *CURRENT, time   
Start date . . . . . . . . . .   *CURRENT     *CURRENT, date   

to schedule the full save.  It just ties up the emulation session ahead of starting the save.

Nicolae Chirea's profile image
Nicolae Chirea IBM Champion

You have to run the job in the control subsystem and it must run the ENDSBS  command with the parameter:

Batch time limit (BCHTIMLMT)

Specifies the amount of time (in minutes) that the system will run in batch restricted state. This parameter is only valid when ending all subsystems from a batch job running in the controlling subsystem. Under this condition, a parameter value must be specified. When this parameter is specified, the system will be ended to the restricted state, with only the batch job running the ENDSBS command remaining active. While the system is in this restricted state, system reference code A900 3C70 is displayed. If the specified time limit is reached, the batch job will be ended and the controlling subsystem restarted. When the job ends, the controlling subsystem will start.

Note: This parameter is recommended only for an application that requires no operator interaction.

Satid S's profile image
Satid S

Dear Miguel

There are 2 ways you can do this: write a batch program to do this or use the usual GO SAVE option 21 menu in an unattended manner.  These 2 IBM Technotes describe each approach:

Running a Full System Save or SAVSYS in Restricted State Batch at https://www.ibm.com/support/pages/running-full-system-save-or-savsys-restricted-state-batch         

How to Perform an Unattended GO SAVE 21 at https://www.ibm.com/support/pages/how-perform-unattended-go-save-21      

The Technote does not indicate any need for transferring job.  

This additional Technote should also be useful for you: Verifying GO SAVE Option 21 was Successful at https://www.ibm.com/support/pages/verifying-go-save-option-21-was-successful              

And if you do save entire system to a tape library, you need to read this Technote: Doing a Full System Save or Native Save Commands to Tape Library Device at https://www.ibm.com/support/pages/doing-full-system-save-or-native-save-commands-tape-library-device