Skip to main content

How-to: Dump all disks on a z/OS system

I've been learning about z/OS and MVS over the last couple of weeks using the Master the Mainframe course and also the highly affordable courses from Interskill. I wanted to build something proper so I built a thing that can backup a full z/OS system to CCKD files (same as what Hercules/Hyperion uses). With the fixes for 64-bit CCKD to Hyperion now merged, and the 64-bit cckddump tooling appears to be in progress, this might come in handy for some folks.

This is the CCKDALL JCL:
//CCKDALL   JOB 1,NOTIFY=&SYSUID
//DUMPJCL   SET DUMPJCL=&&SYSUID..JCL(CCKDDUMP)
//DASDS     EXEC PGM=SDSF
//ISFOUT    DD SYSOUT=*
//CMDOUT    DD DSN=&&SDSF,DISP=(NEW,PASS,DELETE),SPACE=(CYL,1),
//             RECFM=FB,LRECL=100
//ISFIN     DD *
  SET CONSOLE BATCH
  SET DELAY 2
  /D U,DASD,,,9999
  PRINT FILE CMDOUT
  ULOG
  PRINT
  PRINT CLOSE
//*
//FMT      EXEC PGM=ICETOOL
//TOOLMSG  DD
//DFSMSG   DD SYSOUT=*
//IN       DD DSN=&&SDSF,DISP=(OLD,DELETE,DELETE)
//OUT      DD DSN=&&SORTED,DISP=(NEW,PASS,DELETE),SPACE=(CYL,1),
//            RECFM=FB,LRECL=11
//SYMNAMES DD *
ADDR,44,4,CH
TYPE,49,4,CH
STATUS,54,5,CH
VOLID,68,6,CH
//TOOLIN   DD *
  SUBSET FROM(IN) TO(OUT) INPUT REMOVE HEADER(5) TRAILER USING(CTL1)
//CTL1CNTL DD *
  SORT FIELDS=(VOLID,A)
  OUTFIL OMIT=(VOLID,EQ,C'      '),BUILD=(ADDR,C' ',VOLID)
//*
//SKELLIB  EXEC PGM=IEFBR14
//SKELLIB  DD DSN=&&SKELLIB,DISP=(NEW,PASS,DELETE),
//            DCB=(LRECL=80,RECFM=FB),SPACE=(80,(100,0,1),RLSE)
//*
//SKELCOPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT2   DD DSN=&&SKELLIB(SKEL),DISP=(MOD,PASS,KEEP)
//SYSUT1   DD DSN=&DUMPJCL,DISP=SHR
//*
//REXXLIB  EXEC PGM=IEFBR14
//REXXLIB  DD DSN=&&REXXLIB,DISP=(NEW,PASS,DELETE),
//            DCB=(LRECL=80,RECFM=FB),SPACE=(80,(100,0,1),RLSE)
//*
//REXXCOPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT2   DD DSN=&&REXXLIB(RXPGM),DISP=(MOD,PASS,KEEP)
//SYSUT1   DD *
  /* REXX */
  TRACE I
  SIGNAL ON ERROR
  "EXECIO * DISKR DASDLST (FINIS"
  DO WHILE(QUEUED() > 0)
    PARSE PULL ADDR VOLID
    IF VOLID = "DATAZ1" THEN ITERATE
    JOBID = "D@" || VOLID
    SAY "ADDRESS: '" || ADDR || "', VOLID: '" || VOLID || "'"
    ADDRESS ISPEXEC "FTOPEN TEMP"
    ADDRESS ISPEXEC "FTINCL SKEL"
    ADDRESS ISPEXEC "FTCLOSE"
    ADDRESS ISPEXEC "VGET ZTEMPF"
    ADDRESS TSO "SUBMIT '"ZTEMPF"'"
  END
  EXIT 0
  ERROR:
    /* UPDATE ISPF ERROR CODE AS WELL */
    ZISPFRC = 8
    ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
    EXIT 8
//*
//BUILD    EXEC PGM=IKJEFT1A,PARM='ISPSTART CMD(RXPGM)'
//SYSPROC  DD DSN=&&REXXLIB,DISP=(SHR,DELETE,DELETE)
//ISPPROF  DD DISP=(NEW,PASS),DSN=&&ISPPROF,
//            SPACE=(CYL,(2,0,44)),
//            DCB=(RECFM=FB,LRECL=80)
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU
//ISPSLIB  DD DISP=(SHR,DELETE,DELETE),DSN=&&SKELLIB
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//ISPLOG   DD SYSOUT=*,
//            DCB=(LRECL=125,BLKSIZE=129,RECFM=VA)
//SYSTSIN  DD DUMMY
//DASDLST  DD DSN=&&SORTED,DISP=(MOD,DELETE,DELETE)
You also need the CCKDDUMP JCL, which is here:
//&JOBID  JOB 1,NOTIFY=&&SYSUID
//DUMP   EXEC PGM=CCKDDUMP
//STEPLIB  DD DISP=SHR,DSN=&&SYSUID..CCKD.LOAD
//SYSPRINT DD SYSOUT=*,RECFM=VB,LRECL=255,BLKSIZE=4096
//SYSUT1   DD DISP=OLD,UNIT=SYSDA,VOL=SER=&VOLID
//SYSUT2   DD DISP=(,CATLG),DSN=&&SYSUID..&VOLID..CCKD,
//             UNIT=SYSDA,SPACE=(TRK,(65535,),RLSE),
//             LRECL=16384,BLKSIZE=16384,RECFM=F
//*
Make sure to update the references to DATAZ1 if you're dumping somewhere else, and also the DUMPJCL variable in the first JCL to wherever you saved the CCKDDUMP JCL.

Happy dumping!

Comments

  1. Great! However, it seems there seem to be still no solution, so one cannot really dump, for example, a 150000 track sysres?

    ReplyDelete
    Replies
    1. Hi! CCKDUMP compresses, so the limit is actually that the compressed output cannot be above a certain size. If that limit is hit, then you can always move part of the volume away and dump the volume, and then re-assemble it manually.

      Delete
    2. Nice article but I’m curious how you restore the dump after it’s preformed. Do you need the starter system to do that? If so where can I find it?

      Delete

Post a Comment

Popular posts from this blog

Buying an IBM Mainframe

I bought an IBM mainframe for personal use. I am doing this for learning and figuring out how it works. If you are curious about what goes into this process, I hope this post will interest you. I am not the first one by far to do something like this. There are some people on the internet that I know have their own personal mainframes, and I have drawn inspiration from each and every one of them. You should follow them if you are interested in these things: @connorkrukosky @sebastian_wind @faultywarrior @kevinbowling1 This post is about buying an IBM z114 mainframe (picture 1) but should translate well to any of the IBM mainframes from z9 to z14. Picture 1: An IBM z114 mainframe in all its glory Source: IBM What to expect of the process Buying a mainframe takes time. I never spent so much time on a purchase before. In fact - I purchased my first apartment with probably less planning and research. Compared to buying an apartment you have no guard rails. You are left

System z on contemporary zLinux

IBM System z supports a handful of operating systems; z/VM, z/VSE, z/OS, z/TPF, and finally zLinux. All the earlier mentioned OSes are proprietary except for zLinux which is simply Linux with a fancy z in the name. zLinux is the term used to describe a Linux distribution compiled for S390 (31 bit) or S390X (64 bit). As we are talking about modern mainframes I will not be discussing S390, only S390X. There is a comfortable amount of distributions that support S390X - more or less all of the popular distributions do. In this  list  we find distributions like Debian, Ubuntu, Gentoo, Fedora, and RHEL. Noticeably Arch is missing but then again they only have an official port for x86-64. This is great - this means that we could download the latest Ubuntu, boot the DVD, and be up and running in no time, right? Well, sadly no. The devil is, as always, in the details. When compiling high level code like C/C++/Go the compiler needs to select an instruction set to use for the compiled binar

Brocade Fabric OS downloads

Fabric OS is what runs on the SAN switches I will be using for the mainframe. It has a bit of annoying upgrade path as the guldmyr blog can attest to. TL;DR is that you need to do minor upgrades (6.3 -> 6.4 -> 7.0 -> ... > 7.4) which requires you to get all  Fabric OS images for those versions. Not always easy. So, let's make it a bit easier. Hopefully this will not end up with the links being taken down, but at least it helped somebody I hope. These downloads worked for me and are hash-verified when I could find a hash to verify against. Use at your own risk etc. The URLs are: ftp://ftp.hp.com/pub/softlib/software13/COL59674/co-168954-1/v7.3.2a.zip ftp://ftp.hp.com/pub/softlib/software13/COL59674/co-157071-1/v7.2.1g.zip ftp://ftp.hp.com/pub/softlib/software13/COL59674/co-150357-1/v7.1.2b.zip ftp://ftp.hp.com/pub/softlib/software12/COL38684/co-133135-1/v7.0.2e.zip ftp://ftp.hp.com/pub/softlib/software13/COL22074/co-155018-1/v6.4.3h.zip ftp://ftp.hp.c