Thursday, September 7, 2023

How to copy VSAM KSDS, Alternate Index AIX, PATH files without using IDMCAS in an easy way

Suppose you want to copy VSAM KSDS, AIX, PATH files for your testing needs.
 
This involves following steps
 
1. Defining the KSDS file
2. Load the data to the base cluster
3. Define the alternate index and corresponding path
4. Build the alternate index
 
The below sample job uses IBM supplied utility ADRDSSU to dump the PROD.* files and restore them under TEST qualifier.
 
The end result is PROD.* files are copied to TEST.* files
 
//DUMPFLS  EXEC PGM=ADRDSSU                                 
//SYSPRINT DD SYSOUT=*                                      
//OUTF     DD DSN=DUMP.FILE,                        
//            DISP=(NEW,CATLG,DELETE),                       
//            UNIT=SYSDA,                                   
//            DCB=(RECFM=U,BLKSIZE=27998,LRECL=0,DSORG=PS), 
//            SPACE=(CYL,(50,50),RLSE)            
//SYSIN    DD *                                             
   DUMP DS(INC(PROD.MASTER.KSDS, -               
               PROD.MASTER.AIX1, -               
               PROD.MASTER.PATH1)) -             
   OUTDDNAME(OUTF)               -                          
   ALLDATA(*)                    -                           
   ALLEXCP                       -                          
   SPHERE                        -                          
   OPTIMIZE(4)                   -                          
   COMPRESS                      -                          
   TOL(ENQF)                                                
/*                                                          
//RESTRE  EXEC  PGM=ADRDSSU                       
//SYSPRINT DD SYSOUT=*                             
//INPF     DD  DSN=DUMP.FILE,DISP=SHR      
//SYSIN    DD *                                    
   RESTORE INDDNAME(INPF)              -           
   DS(INC (**))                        -           
   CAN CAT SHR REPLACE                 -           
   TOL(ENQF)                           -           
   SPHERE                              -           
   RENAMEU((PROD.MASTER.KSDS,   -       
            TEST.MASTER.KSDS) -       
           (PROD.MASTER.AIX1,   -       
            TEST.MASTER.AIX1) -       
           (PROD.MASTER.PATH1,  -       
            TEST.MASTER.PATH1))       
//*                                                

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.