Storage

Posts related to storage on mainframe

Delete content of a sequential dataset using IDCAMS

The following JCL will delete the content of a sequential dataset without deleting it using the IDCAMS utility:


//DELCONT  EXEC PGM=IDCAMS
//DDDMMY   DD DUMMY
//DDOUT    DD DISP=SHR,DSN=USER1.MYDATA.EXAMPLE
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  REPRO IFILE(DDDMMY) OFILE(DDOUT)

 

Replace USER1.MYDATA.EXAMPLE by the sequential dataset you wish to delete the content of.

Copy content of one Dataset into another using IEBCOPY

The following JCL will allow you to copy the content of one dataset into another via batch job:


//COPY EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//IN  DD DISP=SHR,DSN=USER1.MYDATA.EXAMPLE
//OUT DD DISP=SHR,DSN=USER2.MYDATA.FORYOU
//SYSIN DD *
  COPY INDD=IN,OUTDD=OUT

Replace USER1.MYDATA.EXAMPLE and USER2.MYDATA.FORYOU by your own dataset names.

How to Allocate a Page Dataset

Here’s a simple way to allocate a new Page Dataset via batch job:

//DEFPGSPC EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
  DEFINE PAGESPACE (  -
  NAME(page_dataset_name) -
  CYLINDERS(number_cyls) -
  VOLUME(volume_name))

 

Substitute the following values on the above JCL to meet your requirements:

page_dataset_name – Name of the Page Dataset you want to create

number_cyls – Specify the number of cylinders the new Page Dataset should have

volume_name – Name of the DASD volume where you want the Page dataset to be allocated

 

Bear in mind that the VOLUME parameter is only required if the Page Dataset you’re allocating is not SMS managed.

There are other parameters that can be used when allocating a new Page Dataset. To know more about this you can either check IBM manual ‘DFSMS Access Method Services for Catalogs (SC26-7394-xx) or via TSO command HELP DEFPGSPC.

ADRDSSU – Full Volume Physical Copy

m4s0n501

The following JCL code allows you to perform a full volume physical copy using the ADRDSSU utility:

//STEP1 EXEC PGM=ADRDSSU,REGION=0M
//SYSPRINT DD SYSOUT=*
//INVOL1 DD VOL=SER=volser1,UNIT=3390,DISP=SHR
//OUTVOL1 DD VOL=SER=volser2,UNIT=3390,DISP=SHR
//SYSIN DD *
 COPY FULL -
 INDDNAME(INVOL1) -
 OUTDDNAME(OUTVOL1) -
 ALLDATA(*) -
 ALLEXCP -
 CANCELERROR -
 COPYVOLID -
 ADMINISTRATOR -
 PURGE
/*

Where:

volser1 = INPUT volume
volser2 = OUTPUT volume

 

JCL Explanation:

With the above JCL data from DASD volume volser1 is copied to DASD volume volser2.

ALLDATA(*) indicates that all allocated space in sequential or partitioned datasets, and in datasets with a dataset organization that is null, is to be copied.

COPYVOLID allows the volume serial number of the source volume (volser1) to be copied to the target volume (OUTVOL1). The result is that both volumes will have the same serial number.

ALLEXCP copies datasets even if they are empty.

CANCELERROR terminates the copy operation if a permanent read error occurs.

ADMINISTRATOR allows you to act as a DFSMSdss authorized storage administrator for the COPY command. This is an optional parameter.

PURGE specifies that unexpired data sets, which reside on the target volume, can be overlaid for a full copy operation. If you do not specify PURGE and unexpired data sets exist on the target volume, the copy operation fails. This is an optional parameter.

What is a VSAM Volume Data Set (VVDS)?

VVDS stands for VSAM Volume Data Set and it’s a VSAM file that contains the information of all VSAM and SMS-managed non-VSAM data sets that reside on the volume where the VVDS file is allocated.

A VVDS is recognised by the restricted data set name SYS1.VVDS.Vvolser, where volser is the volume serial number of the volume on which the VVDS resides.

 

VVDS Structure

Record

Description

VVCR

The VSAM Volume Control Record (VVCR) is the first logical record in a VVDS. The VVCR contains information for management of DASD space and the Base Catalog Structure (BCS) names, which currently have VSAM or SMS-managed non-VSAM data sets on the volume. The VVCR might have a pointer to an overflow VVCR.

Self-Describing VVR

The VVDS self-describing VVR (VSAM Volume Record) is the second logical record in the VVDS. The self-describing VVR has the information that describes the VVDS.

VVR or NVR

The remaining logical records in the VVDS can either be VVRs (VSAM Volume Records) for VSAM objects or NVRs (Non-VSAM Volume Records) for SMS-managed non-VSAM data sets. The hexadecimal RBA (Relative Byte Address) of the record is used as its key or identifier.

VVR or NVR

VVR or NVR

 

As a minimum, the VVDS contains two records:

  1. A VSAM Volume Control Record (VVCR)
  2. A VVDS self-describing volume record