1,350 pts.
 SAVF: Backing up all user libraries
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?


Software/Hardware used:
ASKED: September 19, 2011  12:07 PM
UPDATED: March 31, 2012  4:04 PM
  Help
 Approved Answer - Chosen by Rajasekhar15 (Question Asker)

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.

ANSWERED:  Sep 19, 2011  4:03 PM (GMT)  by Rajasekhar15

 
Other Answers:

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.

Last Wiki Answer Submitted:  September 19, 2011  1:02 pm  by  deepu9321   3,370 pts.
Latest Answer Wiki Contributors:  deepu9321   3,370 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 107,995 pts.

 

go to the save menu (go save) and take option23 (all user data)

 10 pts.

 

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,350 pts.

 

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?

 32,835 pts.

 

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,480 pts.

 

charlie can u give me a sample program for this issue

 1,350 pts.

 

Is there a requirement that you must use a save file? If not, Idfalls suggestion is probably the simplest solution.

 5,670 pts.

 

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?

 32,835 pts.

 

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,350 pts.

 

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
 32,835 pts.