MDMOVEDS - batch move datasets off a dasd pack(s)

Function of the utility

The purpose of this program is to batch move datasets from dasd volumes onto another volume. This program is for the MVS3.8J (OS/VS2) operating system running under hercules and will work with TK3 and TK4-.

As RAKF does not implement the DASDVOL rules there is no way to stop users from creating datasets on packs they should not be using, which is obviously a problem for me as I allow 'guest' users on my system.

Running this program periodically is my way of forcing datasets back onto dasd packs they are permitted to be on should the annoying users not read the documentation and create datasets on packs their datasets should not be placed on.

It currently has the following programed limitations

  1. it will currently only move DSORG=PO and DSORG=PS datasets
  2. the new file primary extent will be set to the actual number of tracks used by the dataset (not the total tracks allocated, only the actual tracks used, pgm reads the disk vtoc to see what is allocated)... so be carefull if moving the dataset to a pack with a smaller track size
  3. the new file secondary extent size is hard coded as 1 track
  4. in the case a PDS is being moved the new file number of directory blocks allocated will be the same as in the origional file (pgm reads the pds directory blocls and counts them)
  5. a seperate batch job is submitted to INTRDR for each dataset to be moved, no checking is done that the move was sucessfull; nor is checking required as the datasets being moved (in my use case scenario anyway) should not have existed where they were placed anyway

It has the following requirements that are required in sites using RAKF

Example usage

Move all datasets beginning with GUEST3 from the dasd volumes specified by the DDn cards to the volser/unit also specified in the PARM field.

//MARKASMJ JOB  (0),'ASSEMBLE MDMOVEDS',CLASS=A,MSGCLASS=T,
// USER=someuser,PASSWORD=somepassword
//TESTIT1  EXEC PGM=MDMOVEDS,COND=(0,NE),
// PARM='PREFIX=GUEST3,VOL=PUB012,UNIT=3380'
//STEPLIB  DD   DISP=SHR,DSN=MARK.LIB.LOAD
//SYSPRINT DD   SYSOUT=*
//* --- AUTHCARD CONTAINS THE USERID/PASSWORD JCL CARD
//*    APPENDED AFTER THE JOBCARD
//*    YOU SHOULD HAVE THIS IN A RAKF SECURED PDS, NOT IN JCL :-)
//AUTHCARD DD   DATA,DLM=ZZ
// USER=adminusr,PASSWORD=somepass
ZZ
//* --- INTRDR, BELOW SUBMITS JOB TO INTRDR CLASS A
//INTRDR   DD   SYSOUT=(A,INTRDR)
//* --- AND A LIST OF VOLSERS TO BE VTOC SCANNED
//DD0001   DD   DISP=SHR,UNIT=3350,VOL=SER=MVSRES
//DD0002   DD   DISP=SHR,UNIT=3350,VOL=SER=SRCMD1
//DD0003   DD   DISP=SHR,UNIT=3375,VOL=SER=PUB001
//* THE BELOW SHOULD BE SKIPPED, SAME AS TARGET
//DD0004   DD   DISP=SHR,UNIT=3380,VOL=SER=PUB012
//

Program Source

On the assumption this may be useful to someone, this is the source code. You are free to copy and customise for your own use.