Catalog Moving

This is my first technical article about mainframe after i came to ISSC, I got lots of chance to trainning and learning, it's great helpful for me to improve my skills. Recently , i did some experiment myself. One of them is about moving the catalog.
 
details can be found in the  z/OS DFSMS Managing Catalogs
 
1. Lock the catalog, avoid catalog access when you moving your catalog.
//LOCKCAT EXEC PGM=IDCAMS    
//SYSPRINT DD SYSOUT=A    
//SYSIN        DD *    
            ALTER YOUR.CATALOG.NAME LOCK    
/*
 
2.When you lock your catalog, there may be one problem that make you can't lock it
IDC3009I VSAM CATALOG RETURN CODE IS 186- REASON CODE IS 2
In this case, No profile IGG.CATLOCK of class type FACILITY was found. so we have to define the  IGG.CATLOCK profile by the tso RACF command.
RDEFINE    FACILITY    IGG.CATLOCK    UACC(NONE) OWNER(CATADMIN)

PERMIT    CLASS(FACILITY)    IGG.CATLOCK    ID(USERID) ACCESS(READ)

SETR CLASS(FACILITY) REFRESH
 
3.Now we can use the catlock. Next step is to export the BCS record to a PS.
//EXPORT    EXEC PGM=IDCAMS    
//SYSPRINT DD SYSOUT=A    
//EXPDD     DD DSN=CATBACK.ICFCAT.USER.VSYS303,DISP=OLD    
//SYSIN        DD *    
         EXPORT YOUR.CATALOG.NAME -    
         OUTFILE(EXPDD) -    
         TEMPORARY    
/*
 
4. Delete the old catalog
//DELCAT    EXEC PGM=IDCAMS    
//SYSPRINT DD SYSOUT=A    
//SYSIN        DD *    
            DELETE YOUR.CATALOG.NAME  -    
            RECOVERY -    
            USERCATALOG    
/*
 
5.Redefine the catalog in the new volume.
//DEFCAT1A JOB ,'DEFINE CATALOG',MSGLEVEL=(1,1),CLASS=A,
//                         NOTIFY=&SYSUID,MSGCLASS=X                                
//STEP1 EXEC PGM=IDCAMS                                                                    
//SYSPRINT DD SYSOUT=A                                                                    
//SYSIN DD *                                                                                        
        DEFINE USERCATALOG -                                                                
                     (    NAME(YOUR.CATALOG.NAME)    -                                            
                            MEGABYTES(15 15)        -                                            
                            VOLUME(Z6URS1)         -                                            
                            ICFCATALOG                    -                                            
                            FREESPACE(10 10)        -                                            
                            STRNO(3)     )                -                                            
                     DATA( CONTROLINTERVALSIZE(4096) -                        
                                 BUFND(4)     ) -                                                    
                     INDEX( BUFNI(4)    )                                                        
/*                                                                                                            
 
6.Import the BCS record from the PS you just export.
//FOREST1A JOB ,'IMPORT A CATALOG',CLASS=A,MSGLEVEL=(1,1),
//                         NOTIFY=&SYSUID                                                            
//EXPORT    EXEC PGM=IDCAMS                                                                    
//SYSPRINT DD SYSOUT=A                                                                        
//SYSIN        DD *                                                                                        
     IMPORT INDATASET(SUPER.USERCAT.TEST) -                                    
                    OUTDATASET(USERCAT.TEST)                -                                
                    OBJECTS((USERCAT.TEST     -                                                
                    VOLUMES(Z6SYS1)))            -                                                
                    ALIAS -                                                                                    
                    LOCK -                                                                                    
                    INTOEMPTY                                                                                
/*                                                                                                                
 
7.At last ,use the jcl you at step 1 ,unlock the catalog .Your catalog have been moved successfully!

你可能感兴趣的:(职场,catalog,休闲)