BEGINBUCKET RENAMELIBS
#/ ------------------------------------------------------------------
#BEGINDEFS
#/ ------------------------------------------------------------------
#TABLECALL <MVSDSDATATABLE> KEY:MVS2BDSCODE
#/ ------------------------------------------------------------------
#/EXCEPTIONFORMISSINGSYMBOL
#/ ------------------------------------------------------------------
#BEGINSTATICINSTANCES
#/ ------------------------------------------------------------------
#STATICINSTANCE LANG2BDSCODE=EN;
#/ -------------------------------------------------
#BEGININSTANCEQUALIFIERS
#/ -------------------------------------------------
#/ This doesn't apply for instances
#/ -------------------------------------------------------------------
#BEGINPREFIX
#/ -------------------------------------------------------------------
#BEGININSTANCE               #/ All instance code must resolve to valid SAS source code.
#/ -------------------------------------------------------------------
//STEP010 EXEC PGM=IKJEFT01
//SYSTSPRT DD  SYSOUT=*,DCB=(RECFM=VA,LRECL=125)
//SYSUDUMP DD  SYSOUT=*,DCB=(RECFM=VA,LRECL=125)
//SYSPRINT DD  SYSOUT=*
//SYSTSIN  DD  *
 RENAME '[CUSTPRODQUAL].DBCS.LIBRARY' -
       '[CUSTPRODQUAL].DBCS.LIBRBAK'
 RENAME '[CUSTPRODQUAL].LIBRARY' -
       '[CUSTPRODQUAL].LIBRBAK'
//*
//NEWALLOC EXEC PGM=IEFBR14
//*
//* ALLOCATE 
//*
#TABLEFIX <MVSDSDATATABLE> LB
//ALDBCS DD DSN=[CUSTPRODQUAL].DBCS.LIBRARY,DISP=(NEW,CATLG),
//      SPACE=[SPACEPARMS],
//      DCB=(DSORG=[DSORG],RECFM=[RECFM],LRECL=[LRECL],BLKSIZE=[BLKSIZE]),
#IF [SMS-ALLOC] #THEN SMSALLOC   #/ branch to section if customer using IBM SMS to manage storage     
#IFNOT [VOLSER] #THEN NOVSER  #/ if volser has resolved to null, then branch.              
#IF [TMPDS] #THEN TMPU #/ if this is a pre-allocated dataset deleted after the install then branch         
//      UNIT=[DISKUNIT],VOL=SER='[BYDSVOLSER]'   #/ having volser by dataset allows splitting installation storage        
#THEN NEND                           
#NOVSER                                     
#IF [TMPDS] #THEN TMPU
//      UNIT=[DISKUNIT]     #/ set unit to permanent diskunit                          
#THEN NEND                           
#TMPU                                       
//      UNIT=[TMPUNI]       #/ set unit to temporary diskunit                      
#THEN NEND                           
#SMSALLOC            #/ section for IBM SMS managed storage class specifications                           
#IFNOT [SMS-STORCLAS] #THEN NXCLS           
//      STORCLAS=[SMS-STORCLAS],              #/ STORCLAS keyword, if used       
#NXCLS                                      
#IFNOT [SMS-MGMTCLAS] #THEN NXCLS           
//      MGMTCLAS=[SMS-MGMTCLAS],              #/ MGMTCLAS keyword, if used 
#NXCLS                                      
#IFNOT [SMS-DATACLAS] #THEN NXCLS           
//      DATACLAS=[SMS-DATACLAS],              #/ DATACLAS keyword, if used
#NXCLS                                      
//      UNIT=[DISKUNIT]              #/ hard set to permanent diskunit, SMS not used for temps        
#NEND                                       
#TABLEFIX <MVSDSDATATABLE> LD
//ALDBCS DD DSN=[CUSTPRODQUAL].LIBRARY,DISP=(NEW,CATLG),
//      SPACE=[SPACEPARMS],
//      DCB=(DSORG=[DSORG],RECFM=[RECFM],LRECL=[LRECL],BLKSIZE=[BLKSIZE]),
#IF [SMS-ALLOC] #THEN SMSALLOC   #/ branch to section if customer using IBM SMS to manage storage     
#IFNOT [VOLSER] #THEN NOVSER  #/ if volser has resolved to null, then branch.              
#IF [TMPDS] #THEN TMPU #/ if this is a pre-allocated dataset deleted after the install then branch         
//      UNIT=[DISKUNIT],VOL=SER='[BYDSVOLSER]'  #/ having volser by dataset allows splitting installation storage        
#THEN NEND                           
#NOVSER                                     
#IF [TMPDS] #THEN TMPU
//      UNIT=[DISKUNIT]     #/ set unit to permanent diskunit                          
#THEN NEND                           
#TMPU                                       
//      UNIT=[TMPUNI]       #/ set unit to temporary diskunit                      
#THEN NEND                           
#SMSALLOC            #/ section for IBM SMS managed storage class specifications                           
#IFNOT [SMS-STORCLAS] #THEN NXCLS           
//      STORCLAS=[SMS-STORCLAS],              #/ STORCLAS keyword, if used       
#NXCLS                                      
#IFNOT [SMS-MGMTCLAS] #THEN NXCLS           
//      MGMTCLAS=[SMS-MGMTCLAS],              #/ MGMTCLAS keyword, if used 
#NXCLS                                      
#IFNOT [SMS-DATACLAS] #THEN NXCLS           
//      DATACLAS=[SMS-DATACLAS],              #/ DATACLAS keyword, if used
#NXCLS                                      
//      UNIT=[DISKUNIT]              #/ hard set to permanent diskunit, SMS not used for temps        
#NEND                                       
//CPYTEST  EXEC PGM=IEBCOPY      
//SYSPRINT DD SYSOUT=* 
//SYSUT3   DD UNIT=SYSDA,SPACE=(TRK,(1,1))  
//SYSUT4   DD UNIT=SYSDA,SPACE=(TRK,(1,1))                         
//DDIN   DD DSN=[CUSTPRODQUAL].DBCS.LIBRBAK,DISP=SHR                #/backup library
//DDOUT   DD DSN=[CUSTPRODQUAL].DBCS.LIBRARY,DISP=OLD     #/ production library
//DDIN1   DD DSN=[CUSTPRODQUAL].LIBRBAK,DISP=SHR                #/backup library
//DDOUT1   DD DSN=[CUSTPRODQUAL].LIBRARY,DISP=OLD     #/ production library
//SYSIN    DD DATA,DLM='!1'                          
CP1  COPY  INDD=((DDIN,R)),OUTDD=DDOUT
CP1  COPY  INDD=((DDIN1,R)),OUTDD=DDOUT1
!1
//DELLIB EXEC PGM=IEFBR14,COND=(4,LT)
//*
//DDDELLB  DD DSN=[CUSTPRODQUAL].DBCS.LIBRBAK,
// DISP=(MOD,DELETE,KEEP),UNIT=DISK,SPACE=(TRK,(1,1,1))
//DDDELLD  DD DSN=[CUSTPRODQUAL].LIBRBAK,
// DISP=(MOD,DELETE,KEEP),UNIT=DISK,SPACE=(TRK,(1,1,1))
//*
#/ ----------------------------------------------------------------------
#BEGINSUFFIX 
#/ -------------------------------------------------------------------
#ENDBUCKET COPYPDS
