SAVF: Backing up all user libraries

1395 pts.
Tags:
AS/400 Library
SAVF
SAVLIB
i tried to backup all our user libraries  using savf, but i can't able to give more than one library.how could i sav all the lib?
ex: i have lib's
user1lib
|
user10lib
|
user16lib
i have to sav all the obj init?

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can use SAVLIB command,
enter ‘+’ for more values
<pre> Save Library (SAVLIB)

Type choices, press Enter.

Library . . . . . . . . . . . . + Name, generic*, *NONSYS…
+ for more values
Device . . . . . . . . . . . . . Name, *SAVF, *MEDDFN
+ for more values </pre>

You will be able to enter more than one Library Name

<pre> Specify More Values for Parameter LIB

Type choices, press Enter.

Library . . . . . . . . . . . . LIB1 Name, generic*, *NONSYS…
LIB2
LIB3

</pre>

Pradeep.

Discuss This Question: 12  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    I do not believe the above answer is correct. It will produce CPF3789: Only one library allowed with specified parameters. What you can fo is to create a new library. Then either manually or with a CL, do a CRTSAVF in that library with the name of the library you are saving, then do a SAVLIB for a single library to that *SAVF. Now loop through the above process for each library you want to save. End result wil a a single library with a *SAVF for each library you wanted to save. You can then backup that library to tape or sent it to a backup location.
    41,380 pointsBadges:
    report
  • TomLiotta
    While multiple libraries can be specified on a SAVLIB command, they can only be specified when DEV(*SAVF) is not also specified. CharlieBrowne is correct. To get multiple libraries into a single savefile, they must first be saved into individual savefiles that have been created in the same library. After each savefile has been populated, you can then save that one library into a single savefile with SAVLIB SAVFDTA(*YES). Later, that library can be restored and the individual libraries can be restored from the savefiles that are in it. (Or an individual savefile can be restored from the consolidated savefile, and a library can be restored out of that individual savefile.) In short, it takes multiple steps if savefiles are going to be used. Tom
    125,585 pointsBadges:
    report
  • Idfalls
    go to the save menu (go save) and take option23 (all user data)
    10 pointsBadges:
    report
  • Rajasekhar15
    charlie u r correct, its says the same error, but i don't know CL, is there any other way ,plz help me, or else i have to sav one by one...:-(
    1,395 pointsBadges:
    report
  • CharlieBrowne
    If you must use *SAVF, then you can only do one at a time. Can you go to TAPE? Is this something you want to run once or everyday?
    41,380 pointsBadges:
    report
  • Rickmcd
    If you are on V5R4 and above and have enough disk space research Virtual tape. You can then use savlib to save all user libraries to the Virtual tape that resides in the IFS.
    1,605 pointsBadges:
    report
  • Rajasekhar15
    charlie can u give me a sample program for this issue
    1,395 pointsBadges:
    report
  • Splat
    Is there a requirement that you must use a save file? If not, Idfalls suggestion is probably the simplest solution.
    7,455 pointsBadges:
    report
  • CharlieBrowne
    Rajasekhar15 -- Can you answer these questions. There are various solutiuons depending on what your requirement is. The answer could be as simple as a couple of User Defined PDM options to creatiing a DB that has the libraries you want to save, to dynamically creating a list of libraries each time you run it. 1. If you must use *SAVF, then you can only do one at a time. 2. Can you go to TAPE? 3. Is this something you want to run once or everyday? 4. Is the list of libraries static or can be be changing? 5. How many libraries in need to be included?
    41,380 pointsBadges:
    report
  • Rajasekhar15
    1. If you must use *SAVF, then you can only do one at a time. i need to do in save file 2. Can you go to TAPE? no i can't 3. Is this something you want to run once or everyday? r u asking abt those lib r wat? but i'm not going to use those lib right, might be in future. 4. Is the list of libraries static or can be be changing? objects in the libraries r cobal prgms 5. How many libraries in need to be included? 16 lib thanks in advance charlie......:-)
    1,395 pointsBadges:
    report
  • CharlieBrowne
    This should do it for you.
    /* *******************************************************************/            
    /* Program Name : LIBS2SAVF                                          */            
    /* Description  : Save Selected Librarties to a *SAVF                */            
    /*                                                                   */            
    /*  Created By : Charlie Browne                                      */            
    /*  Create Date : 09/22/11                                           */            
    /* *******************************************************************/            
                 PGM                                                                   
                                                                                       
    /*-------------------------------------------------------------------*/            
    /* Define the variables                                              */            
    /*-------------------------------------------------------------------*/            
                 DCL        VAR(&wJobNbr)  TYPE(*CHAR) LEN(06)                         
                 DCL        VAR(&JobLib )  TYPE(*CHAR) LEN(10)                         
                 DCL        VAR(&SaveLib)  TYPE(*CHAR) LEN(10)                         
                                                                                       
    /*-------------------------------------------------------------------*/            
    /* Retrieve Job Number to build Job library                          */            
    /*-------------------------------------------------------------------*/            
                 RTVJOBA    NBR(&wJobNbr)                                              
                                                                                       
    /*-------------------------------------------------------------------*/            
    /* Create the library and make it first in the list                   */           
    /*-------------------------------------------------------------------*/            
                 Chgvar     &JobLib  ('JOB' || &wJobNbr)                               
                 CRTLIB     LIB(&JobLib) TYPE(*TEST)                                   
                 ADDLIBLE   &JobLib                                                    
                                                                                       
    /*-------------------------------------------------------------------------*/      
    /*  Create *SAVF with name of library to be saved                          */      
    /*  Save that library to the *SAVF                                         */      
    /*                                                                         */      
    /*  Replace 'YourLib' with the name of a library you want to save          */      
    /*   Do this for each of the 16 occurances. Then compile program           */      
    /*-------------------------------------------------------------------------*/      
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                 Chgvar     &SaveLib  'YourLib'                                        
                 CallSubr   SrSaveLib                                                  
                                                                                       
                                                                                       
    Subr       Subr(SrSaveLib)                                                         
                 CrtSavf    &JobLib/&SaveLib                                           
                 Savlib     &Savelib *savf SAVF(&JobLib/&SaveLib) SAVACT(*LIB)         
    EndSubr                                                                            
                                                                                       
    END:         ENDPGM
    41,380 pointsBadges:
    report
  • Rajasekhar15
    [...] 8. CharlieBrowne offers another approved answer, this time on SAVF: Backing up all user libraries. [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following