Wednesday, July 1, 2015

What is SMS in mainframe ? SMS stands for Storage Management Subsystem

Introduction:
The Storage Management Subsystem (SMS) automates the use of storage for data sets.  The z/OS ,  system is not aware of how much space a dataset will need, where it will be stored(Disk or Tape) ,what will be its record format and other details. Z/oS storage team need to decide whether to backup the large files and also need to recall it when necessary. All these data management activities can be done either manually or through the use of automated processes which is nothing but SMS.  With SMS activated , the z/OS  programmer or storage admin team  may, for example, create model data definitions for typical data sets, so that SMS automatically assigns those  attributes to data sets when they are created.
The data sets allocated through SMS are called system-managed data sets or SMS-managed data sets. For example, suppose you want to create a new data set named DATA.LIST. If SMS is active, you could use JCL like this:
//NEWDS DD DSN=myid.test.dataset1,
// DISP=(NEW,CATLG),
// DATACLAS=DCSL002,
// STORCLAS=SRTCL00

In this case, z/OS can use characteristics from predefined data and storage classes when it creates the DATA.LIST data set.

If SMS is not active or not in use, you need to manually specify the space requirements and storage location for the new data set, and your JCL would look like this :
//NEWDS DD DSN=myid.test.dataset1,
// DISP=(NEW,KEEP),
 // SPACE=(CYL,(1,1)),
 // UNIT=SYSDA,
// VOL=SER=SHARED  

The advantages associated with an SMS environment.
 • The user is relieved of making decisions about resource allocation of data sets, since it is done by SMS.
 • SMS provides the capability of concatenating data sets of unlike devices. For example, a tape data set can be concatenated with a disk data set. This capability is not available in a non-SMS environment.
 • SMS managed data sets cannot be deleted unless they are first uncataloged. Due to this extra step, erroneous deletion of data sets is minimized.
 • Additional features are available in the use of IDCAMS in an SMS environment. For example, the ALTER command can be used to increase the limit of the number of generation data sets in a GDG. This feature is not available in a non-SMS system.
 • VSAM data sets created in an SMS environment offer more flexibility that those created through JCL in a non-SMS environment.

Read about the  SMS Parameters in the next post

An overview of SMS parameters: STORCLAS,DATACLAS,MGMTCLAS,RECORG

1. The STORCLAS Parameter:
STORCLAS is a keyword parameter. It is used to assign a data set to an SMS defined class. 
These parameters discused below have significance only if SMS is active, otherwise it is ignored. 
Here’s the syntax: 
STORCLAS = class
Where class is an installation defined name and can be one to eight characters long. Use of this parameter results in the data set defined in the DD statement within that job being SMS-managed. The VOLUME and UNIT parameters can be omitted, since these values are now SMS supplied.
As we can see in the below example, VOLUME and UNIT parameters are omitted. These parameters will be installation defined for the class SMS1.
//JOB1 JOB (A123), ‘Ryan’
//STEP1 EXEC PGM=PROGRAM1
//DD1 DD DSN=myid.test.dataset1,
// DISP=(NEW, CATLG, DELETE),
// SPACE=(CYL, (1,1), RLSE),
// LRECL=80,
// RECFM=FB,
// STORCLAS=SMS1 

2. The DATACLAS Parameter:
DATACLAS is a keyword parameter. It is used to define any or all of the following parameters for a data set.(Marked in blue)
LRECL, RECORG , RECFM,  RETPD or EXPDT ,VOLCOUNT (coded on the VOL parameter) , 
SPACE , AVGREC
 Volcount is coded on VOL parameter. It is used to specify the number of tape volumes that can be mounted when a tape data set is being created or expanded.
For SMS managed VSAM data sets, DATACLAS can be used to define the following parameters: CISIZE, IMBED ,REPLICATE, SHAREOPTIONS ,FREESPACE 

Here’s the syntax of the DATACLAS parameter:
DATACLAS = class
Class is installation defined with predefined values for any of the above parameters

Suppose a class named GENERAL contains the following definitions:
SPACE = (CYL, (1,1), RLSE),
DCB= (RECFM=FB, LRECL=80)
My job uses the Class GENERAL in JCL

//JOB1 JOB (A123), ‘Ryan’ /
/STEP1 EXEC PGM=PROGRAM1
//DD1 DD DSN=myid.test.dataset1,
// DISP=NEW, CATLG, DELETE),
// UNIT=SYSDA,
// DATACLAS=GENERAL 

3. The MGMTCLAS Parameter 
This parameter is used to provide a management class for the associated data set coded in the DD statement. A management class is used to control the migration of data sets, the frequency of back ups, the number of backups versions, and the retention criteria of backup versions.
Here’s the syntax:
MGMTCLAS = class
It can be one to eight characters long. Parameters defined for this class can not be overridden. Example:
//JOB1 JOB (A123), 'Ryan’
//STEP1 EXEC PGM=PROGRAM1
//DD1 DD DSN=myid.test.dataset2
// DISP=(NEW, CATLG, DELETE),
// DATACLAS=GENERAL,
// MGMTCLAS=ARCHIVE

4. The LIKE Parameter:
 This parameter is used to copy attributes from an existing cataloged data set to a new data set. The following attributes can be copied over: SPACE RECFM AVGREC LRECL

Here’s the syntax:
LIKE = model.dataset
Where model.dataset identifies the name of the model data set.
Example:

//JOB1 JOB (A123), ‘Ryan’
//STEP1 EXEC PGM=PROGRAM1
//DD1 DD DSN=myid.test.dataset3,
// DISP=(NEW, CATLG, DELETE),
// LIKE=TEST.MODEL
 In this example, the  attributes of the data set TEST.MODEL is copied to the new data set called TEST.DATA2.