IBM Security Z Security

Copy CKFREEZE or UNLOAD data sets

  • 1.  Copy CKFREEZE or UNLOAD data sets

    Posted Thu August 13, 2020 01:28 PM
    Edited by Rob van Hoboken Thu August 13, 2020 01:28 PM
    You might have noticed that zSecure UNLOAD and CKFREEZE data sets have interesting data set characteristics, and many data set management products refuse to process them.  This was particularly annoying for a customer that had to enable encryption for (historical) zSecure snapshots.  New snapshot data sets got allocated with the right KEYLABEL but the old data sets remained unencrypted.  Copying the data sets to a new (encrypted) data set was a challenge.
    However, zSecure knows how to read UNLOAD and CKFREEZE, so we were able to use a CARLa program to copy the old data set, like so:

    //JCLLIB JCLLIB ORDER=(CKR240.CKRPARM,
    //   CKR240.SCKRPROC)
    // INCLUDE MEMBER=C2R$PARM
    //*
    //STEP1 EXEC C2RC
    //INPUT DD DISP=SHR,DSN=CKR.SYSA.RECENT0.UNLOAD
    //OUTPUT DD DISP=(NEW,CATLG),DSN=CKR.SYSA.NEWNAME.UNLOAD,
    //   UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE),
    //   RECFM=VBS,DSORG=PS,LRECL=X,BLKSIZE=0,DSNTYPE=EXTREQ
    //SYSIN DD *
    deftype type=#copy
    alloc type=#copy dd=input
    newlist type=#copy nopage dd=output
       list record(0)

    Notes:
    1. The LIST command write records in their original order.  Imagine what would happen if you changed it into SORTLIST...
    2. RECORD(0) writes all of the record.  The default field length of this field is 72 so, if you omit the length override, only 72 positions of each record are copied.
    3. Normally, (0) would trim trailing blanks, but in a deftype newlist, RECORD is an ASIS format field and (0) does not trim blanks.


    ------------------------------
    Rob van Hoboken
    ------------------------------