
Chapter 9. FlashCopy interfaces  109
Example 9-21   FlashCopy withdraw target only
//*********************************************************************
//*    WITHDRAW FLASHCOPY RELATIONSHIP                                *
//*    TARGET ONLY                                                    *
//*    TDEVN - TARGET FLASHCOPY VOLUME                                *
//*********************************************************************
//STEP1    EXEC PGM=IKJEFT01,REGION=256K                               
//SYSTSPRT DD  SYSOUT=*                                                
//SYSUADS  DD  DSN=SYS1.UADS,DISP=SHR                                  
//SYSLBC   DD  DSN=SYS1.BRODCAST,DISP=SHR                              
//SYSTSIN  DD  *                                                       
  FCWITHDR TDEVN(X'320B')                                              
/*
In Example 9-22, both the SDEVN parameter and the TDEVN parameter allow you to limit the 
scope of the withdraw to those FlashCopy relationships that have source extents on the 
specified SDEVN and corresponding target extents on the TDEVN, regardless of whatever 
source and target relationships with other devices may exist. 
Example 9-22   FlashCopy withdraw source and target
//*********************************************************************
//*    WITHDRAW FLASHCOPY RELATIONSHIP                                *
//*    SDEVN - SOURCE FLASHCOPY VOLUME                                *
//*    TDEVN - TARGET FLASHCOPY VOLUME                                *
//*********************************************************************
//STEP1    EXEC PGM=IKJEFT01,REGION=256K                               
//SYSTSPRT DD  SYSOUT=*                                                
//SYSUADS  DD  DSN=SYS1.UADS,DISP=SHR                                  
//SYSLBC   DD  DSN=SYS1.BRODCAST,DISP=SHR                              
//SYSTSIN  DD  *                                                       
  FCWITHDR SDEVN(X’320A’) TDEVN(X'320B')                               
/*
The FCWITHDR command with the DDSW(YES) (deleted data space withdraw) parameter, 
when issued against an entire source volume, removes all target extents on the specified 
source device from their associated FlashCopy relationships. In addition, any FlashCopy 
NOCOPY source tracks on the specified source device are changed to COPY (background 
copy) source tracks. This process causes all source tracks to be copied to their respective 
target tracks and all FlashCopy relationships to be removed from the specified source device. 
The FCWITHDR command in Example 9-23 withdraws all source extents on the source 
device 320A from their associated FlashCopy relationships regardless of the location of their 
corresponding target extents, and all target extents on the source device regardless of the 
location of the corresponding source extents. 
Example 9-23   FCWITHDR and DDSW parameter
//*********************************************************************
//*    WITHDRAW FLASHCOPY RELATIONSHIP                                *
//*    SDEVN - SOURCE FLASHCOPY VOLUME                                *
//*    DDSW(YES)                                                      *
//*********************************************************************
//STEP1    EXEC PGM=IKJEFT01,REGION=256K                               
//SYSTSPRT DD  SYSOUT=*                                                
//SYSUADS  DD  DSN=SYS1.UADS,DISP=SHR                                  
//SYSLBC   DD  DSN=SYS1.BRODCAST,DISP=SHR                              
//SYSTSIN  DD  *                                                       
  FCWITHDR SDEVN(X’320A’) DDSW(YES)