Archive for category Storage

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.

No Comments

ADRDSSU – Full Volume Physical Copy

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.

No Comments

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

No Comments

Change Data Set SMS Information

Sometimes we come across the need of changing the SMS information of a data set. The question of course is: how can we do it? Well, an easy way is to do it via batch job using the IDCAMS utility and the ALTER command:


//SMSCHG EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
 ALTER entryname STORCLAS(new-storclas) -
 MGMTCLAS(new-mgmtclas)

 

Example:


//SMSCHG EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
 ALTER USER1.JCL.CNTL STORCLAS(SC000001) -
 MGMTCLAS(NOMIG)

 
In the example above, we will change the Management Class (MGMTCLAS) and Storage Class (STORCLAS) of dataset ‘USER1.JCL.CNTL’ to ‘NOMIG’ and ‘SC000001′ respectively.

Alternatively, we can also issue the ALTER instructions as a TSO command:


TSO ALTER USER1.JCL.CNTL STORCLAS(SC000001) MGMTCLAS(NOMIG)

No Comments

Most Common Out-Of-Space Abends and Error Codes

Although many other space related abends and error codes may occur, the truth is that some are more common than others. The following table lists the ones that fall under the most common out-of-space abends and error codes:

 

Abend / Error Explanation
B37-04 Insufficient space/extents on current volume and no additional volumes available
B37-08 VTOC (Volume Table Of Contents) conversion routine failed
B37-0C Too many open datasets on device
D37-04 No secondary space specified
E37-04 No more volumes specified
E37-08 No space available on new volume
E37-0C DADSM (Direct Access Device Space Management) exit rejected extend
IEC028I 837-08 Dataset allocation requires more than 5 volumes
IEC070I 203-204 No secondary space specified
IEC070I 104-034 Max extents or max RBA (Relative Byte Address) limit reached
IEC070I 104-204 VSAM – Insufficient space on current volume and no additional volumes available or max extents reached
IEC217I B14-0C There is no space left in the dataset directory, or there is no space left in the dataset for writing an EOF (End Of File) record

No Comments

The IEFBR14 utility

IEFBR14 is an IBM utility better known for being a dummy utility because it does almost nothing. IEFBR14 performs no other action than return a completion code of 0. However, submitting JCL to run the IEFBR14 utility invokes other system components that perform the following useful tasks:

  1. Allocate new flat files
  2. Delete files
  3. Testing

 

Allocate new file


//NEWFILE  EXEC PGM=IEFBR14,
//DD1      DD DSN=USER1.NEWFILE,
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(CYL(1,1),RLSE),
//         DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PS)
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD DUMMY

 

Delete file


//DELFILE  EXEC PGM=IEFBR14
//DD1      DD DSN=USER1.NEWFILE,
//         DISP=(MOD,DELETE,DELETE),
//         SPACE=(TRK,0)
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD DUMMY

 

Testing Purposes

For example, submitting JCL to run IEFBR14 causes the z/OS job scheduler to check your JCL statements for syntax errors.

No Comments

DFSMSdfp Utility – IEBCOPY

IEBCOPY is a DFSMSdfp utility used to perform the following tasks:

  • Copy all or part of a partitioned dataset (PDS) or PDSE
  • Merge partitioned datasets (except when unloading)
  • Create a sequential form of a partitioned dataset or
  • Reload one or more members from a PDSU into a partitioned dataset or PDSE
  • Selected members of a PDS or PDSE can be copied to another or the same PDS or PDSE and/or renamed
  • Exclude members from a dataset to be copied, unloaded, or loaded (except on COPYGRP)
  • Compress a partitioned dataset to reclaim unused space
  • Upgrade a load module for faster loading by MVS program fetch
  • Copy and reblock load modules
  • Convert load modules in a partitioned dataset to program objects in a PDSE when copying a partitioned dataset to a PDSE
  • Convert a PDS to a PDSE or a PDSE to a PDS
  • Copy to or from a PDSE dataset, a member and its aliases together as a group (COPYGRP)

 

Sample IEBCOPY JCL:

//STEPCOPY EXEC PGM=IEBCOPY
//OLDFILE  DD DSN=USER1.FILE.OLD,DISP=SHR
//NEWFILE  DD DSN=USER1.FILE.NEW,DISP=OLD
//SYSUT3   DD UNIT=SYSDA,SPACE=(TRK,(30,30),RLSE)
//SYSUT4   DD UNIT=SYSDA,SPACE=(TRK,(30,30),RLSE)
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN    DD *
<control statements>
/*

IEBCOPY Control Statements:

COPY, ALTERMOD, COPYMOD, SELECT, and EXCLUDE are control statements that can be used with IEBCOPY.

To continue control statements in the following line, a non-blank character needs to be placed in column 72. The statement should then continue in the following line, starting at column 16.

 

COPY

This statement indicates the beginning of a copy operation and identifies the DD statements to be used during the copy.  The format of the COPY control statement is:

{label} COPY OUTDD=ddname,

        INDD=(ddname1,ddname2,(ddname3,R),...)

        {,LIST=NO}

 

The LIST=NO keyword is optional and tells IEBCOPY that you don’t want a list of the members in the PDS.

COPY can be abbreviated as ‘C’, OUTDD as ‘O’, and INDD as ‘I’.

R is to be used when you want all identically named members to be replaced on the output file.

 

Example 1 – Copy all with replace:

{label} COPY OUTDD=O,INDD=((I,R))

 

Example 2 – Copy without replace:

{label} C O=TAPE,I=DASD

 

Example 3 – Compress-in-place:

{label} COPY OUTDD=SYSUT1,I=SYSUT1

 

SELECT

The SELECT statement is used to name members to be included in a copy operation.

The SELECT statement must be preceded by a COPY or COPYMOD statement, or the INDD= portion of a COPY statement.

A SELECT statement may not appear in the same COPY operation as an EXCLUDE statement, neither can SELECT be used in a compress operation.

A SELECT member is only replaced in the output dataset if the REPLACE option (‘R’) is set on the SELECT statement or on the INDD portion of the COPY statement.

 

Format 1 – Copy selected members:

{label} SELECT MEMBER=name

 

Format 2 – Copy a list of members:

{label} SELECT MEMBER=(name1,name2,name3…)

 

Format 3 – Copy a list of members and rename them:

{label} SELECT MEMBER=((name1,newname1),(name2,newname2),…)

 

Format 4 – Copy a list of members with replace:

{label} SELECT MEMBER=((name1,,R),(name2,,R),…)

 

 

EXCLUDE

The EXCLUDE statement is used to name members to be excluded from a copy operation.

The EXCLUDE statement must be preceded by a COPY or COPYMOD statement, or the INDD= portion of a COPY statement.

An EXCLUDE statement may not appear in the same COPY operation as a SELECT statement, neither can EXCLUDE be used in a compress operation.

 

The format of the SELECT control statement is:

{label} EXCLUDE MEMBER=(name1,name2,name3,…)

 

1 Comment

DFSMSdfp Utility – IEBGENER

IEBGENER is a DFSMSdfp utility used to perform the following tasks:

  1. Produce a backup copy of a sequential dataset, a member of a PDS or PDSE or a z/OS Unix file
  2. Produce a PDS or PDSE, or a member of either, from a sequential file or a z/OS Unix file
  3. Expand an existing PDS or PDSE dataset
  4. Produce an “edited” sequential dataset, PDS, PDSE, or a member in either
  5. Handle double-byte character set data DBCS data
  6. Produce printed list of either sequential datasets, PDS/PDSE members or z/OS Unix files
  7. Re-block a dataset or change its logical record length
  8. Provide exit or editing capabilities for label processing, input data editing, key creation, or permanent I/O error processing
  9. Copy user labels on sequential output data sets

 

General structure:

//PROG EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=...,DISP=...
//SYSUT2 DD DSN=...,DISP=...
//SYSIN DD *
control statements...
/*

 

Where:

SYSPRINT DD statement is required. It defines a sequential dataset for messages. The dataset can be written to a system output device, a tape volume, or a DASD volume.

SYSUT1 DD statement points to the input file for the IEBGENER operation. It can define a sequential dataset, a member of a partitioned dataset or PDSE or a z/OS UNIX file. A sequential dataset can be basic format, large format, extended format, compressed format, spooled input, tape, card reader, TSO terminal or DUMMY.

SYSUT2 DD statement points to the output file for the IEBGENER operation. It can define a sequential dataset, a member of a partitioned dataset or PDSE, a partitioned dataset or PDSE or a z/OS UNIX file. A sequential dataset can be basic format, large format, extended format, compressed format, spooled output, tape, card punch, printer, TSO terminal or DUMMY. Reblocking is accomplished if the SYSUT2 BLKSIZE is a new maximum blocksize.  RECFM must be specified for the SYSUT2 file if the dataset is new or DUMMY.  BLKSIZE must always be specified for the SYSUT2 DD statement if LRECL and RECFM are also specified.

SYSIN DD specifies the control statements or DUMMY. SYSIN control statements can be on DASD, TAPE or in-stream data. The SYSIN block size must be multiple of 80, with a maximum allowed BLKSIZE of 32,720, and a RECFM of F or FB.

 

For more information please check IBM manual: z/OS DFSMSdfp Utilities.

No Comments

SMS Classes and Groups

Through Automatic Class Selection (ACS) routines, SMS assigns classes to data based on its requirements and attributes and select specific storage groups to store the data. In order to do this, SMS (Storage Management System) uses classes and groups that are associated or assigned to data sets, objects and volumes.

 

Types of SMS classes and Groups

Data Class Data definition parameters - collection of allocation and space attributes that the system uses when creating a data set
Storage Class Availability and accessibility requirements. It provides the criteria that SMS uses in determining an appropriate location to place a data set or object. SMS uses the storage class to select a device according to the following criteria: device performance, the amount of space available on the volume, and how available a data set or object can be on that device.
Management Class Data migration, backup, and retention attributes. For data sets, these attributes control retention, migration, backup, and release of allocated but unused space. For OAM objects, the attributes control retention, backup, and class transition.
Storage Group List of storage volumes with common properties. It can be collections of DASD volumes, volumes in tape libraries or in optical libraries, or virtual input/output (VIO) storage.
Aggregate Group Backup or recovery of all data sets in a group in a single operation. An aggregate group  is a collection of user-defined data sets that are processed together such as the collection of data sets used for a payroll program. DFSMShsm can back up and recover aggregate groups. A storage administrator might group related data sets in this manner:

  • must be processed as a group
  • are required to run a user application
  • can be used for disaster recovery
  • are being transferred from one site to another
Copy Pool A pool of storage groups to be processed collectively for fast replication operations

 

No Comments

Batch Job to delete a specific member of a Partitioned dataset

If you come across the need to delete a specific member of a Partitioned dataset and you want to do it via batch job, then you can use IDCAMS for the effect:


//DELETE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE USER1.PDS.EXAMPLE(MEMBER1)

 

In the above example member MEMBER1 of the partitioned dataset USER1.PDS.EXAMPLE will be deleted.

No Comments

%d bloggers like this: