Example 8: Recover deleted members of a PDS data set


//JOB008   JOB ...
//RECOVER  EXEC PGM=IQIBUTIL,
//         PARM='RC4NOREP,MAXRC=4,LIST=YES'
//STEPLIB  DD DISP=SHR,DSN=IQI.SIQILOAD
//IQIBUDFL DD DISP=SHR,DSN=IQI.SIQIPLIB
//FROMDD   DD DISP=SHR,DSN=MROTTER.RELEASE.SOURCE
//MYPDS    DD DISP=OLD,DSN=MROTTER.DEV.SOURCE
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
COPMEMS   C I=FROMDD,O=MYPDS
   S M=(MEM$$Z,MEM005,MEMX)
DELMEMS   DELETE OUTDD=MYPDS
   SELECT MEMBER=MEM*
RECMEMS   RECOVER O=MYPDS,NUMBER=3
/*

This example has these three steps:

  • COPMEMS - Copy three members.
  • DELMEMS - Delete the just-copied three members along with all members with same prefix names.
  • RECMEMS - Recover the three members that have been copied in the first step and deleted in the second.

If one or more members cannot be copied in the first step, the job terminates due to the EXEC PARM combination of RC4NOREP,MAXRC=4.

Since the three members, copied in the first step are the most recently written members, after being deleted, they become the first candidates for recovery.

A recovered member name starts with 9Z followed by a six character TTR of the member location. Assuming the recovered member names are 9Z01AB03, 9Z01AB09 and 9Z01AC02, they correspond to members MEM$$Z, MEM005, and MEMX.