Unloading consistent data from a database object without affecting its availability is one of the functions that
Quick Copy for Db2 for z/OS (PQC) and Fast Unload for Db2 for z/OS PFU) support.
With Quick Copy and Fast Unload, you can perform consistent unload.
It is a two-step process that leverages ability of Fast Unload to unload data from a snapshot copy.
Firstly, you create a consistent snapshot copies of your tablespace partitions.
The keyword here are CONSITENT and SNAPSHOTIWAIT NO.
//PQC EXEC
//SYSIN DD *
TEMPLATE T1
DSN(SHK8.PQC800.&DB..&TS..P&PART.)
COPY TABLESPACE DB.ZPCRD2
SSCOPYDDN(T1)
SNAPSHOTACCESS INSTANT
SHRLEVEL CHANGE
SNAPSHOTIWAIT NO
CONSISTENT
Secondly, you unload data from the snapshot copies of tablespace partitions identified by DD statements.
This is a standard Fast Unload job step. The Keyword here is INPUT-FORMAT FLASHCOPY.
//PFU EXEC
//COPY2001 DD DISP=SHR,DSN=SHK8.PQC800.DB.ZPCRD2.P00001
//COPY2002 DD DISP=SHR,DSN=SHK8.PQC800.DB.ZPCRD2.P00002
//*
//TS2REC01 DD DISP=(,CATLG),SPACE=(TRK,(9,9)),
// DSN=PQC.P800.DEMO.ULD2
//*
//SYSIN DD *
FASTUNLOAD
INPUT-FORMAT FLASHCOPY
INDDN COPY20
INDDN-COUNT 2
UNLDDN TS2REC
LOAD-CONTROL FASTLOAD
OUTPUT-FORMAT EXTERNAL
SELECT * FROM PD.TZPCRD2;