How not to use SMS and other DFP opportunties

I wanted to unterse a file, and use DFDSS to restore the datasets. This pretty trivial task had a few problems, and I learned a few things from it. (Well, to be accurate, I fell over the same problems as last time I did it, but I hadn’t bother writing down the solutions.)

Running out of space

My original JCL to unterse a file was

//S1 EXEC PGM=AMATERSE,PARM=UNPACK
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=COLIN.UNTRS,SPACE=(CYL,(100,100)),DISP=(,PASS)

This gave me

IGD17272I VOLUME SELECTION HAS FAILED FOR INSUFFICIENT SPACE FOR
DATA SET COLIN.UNTRS
JOBNAME (COLINMQ3) STEPNAME (S1 )
PROGNAME (AMATERSE) DDNAME (SYSUT2 )
REQUESTED SPACE QUANTITY = 83003 KB
STORCLAS (SCBASE) MGMTCLAS ( ) DATACLAS ( )
STORGRPS (SGBASE SGEXTEAV )

This was annoying as I had plenty of disks space – but not in the SMS storage groups listed.

I fixed this by allocating the dataset outside of SMS. I used

//SYSUT2 DD DSN=COLIN.UNTRS,SPACE=(CYL,(100,100)),DISP=(NEW,CATLG),
// VOL=SER=C4PRD3,UNIT=3390,STORCLAS=SCNOSMS

See One Minute SMS for more information.

DFDSS restore challenges

Having unzipped my file I needed to restore it to create the data sets. I used

//S2 EXEC PGM=ADRDSSU,REGION=0M
//SYSPRINT DD SYSOUT=*
//D1 DD DISP=SHR,DSN=.S1.SYSUT2
//DD1 DD DISP=SHR,DSN=COLIN.UNTRS
//SYSIN DD *
RESTORE –
IMPORT –
INDDNAME(DD1) –
CANCELERROR –
DATASET(INCLUDE()) – RENAMEU( – (.SCSQANLC,COLIN.MQ930.SCSQANLC) –

) –
SHARE –
NULLMGMTCLAS –
NULLSTORCLAS –
CATALOG

/*

It took several goes to get right. Once it was partially working, I got return code 8 because data sets existed.

I tried using REPLACE, but this did not work

REPLACE only applies if the data set is not being renamed. REPLACEUNCONDITIONAL should be used when renaming a data set and a
preallocated target data set should be replaced.

Restoring the datasets had problems.

The job had two steps

  1. Unterse the dataset into a temporary data set
  2. Restore from the temporary data set and recreate the libraries

Depending on the SMS setup this may not work.

If the temporary file was allocated to VIO (a Virtual data set using virtual memory), the DFDSS restore job failed with a message INPUT DEVICE TYPE IS INVALID FOR TASK. I guess the code checks to see if the data set is on a 3390 or tape drive ? If not – then it must be an error!

If a real data set was used (non VIO), it worked.

The error messages were

ADR101I (R/I)-RI01 (01), TASKID 001 HAS BEEN ASSIGNED TO COMMAND ‘RESTORE ‘
ADR109I (R/I)-RI01 (01), 2022.145 13:25:30 INITIAL SCAN OF USER CONTROL STATEMENTS COMPLETED
ADR025E (001)-DEVSU(03), INPUT DEVICE TYPE IS INVALID FOR TASK
ADR017E (001)-CLTSK(01), 2022.145 13:25:30 TASK NOT SCHEDULED DUE TO ERROR. TASK RETURN CODE 0008
ADR012I (SCH)-DSSU (01), 2022.145 13:25:30 DFSMSDSS PROCESSING COMPLETE. HIGHEST RETURN CODE IS 0008 FROM: TASK 001

When I used

//SYSUT2 DD DSN=COLIN.UNT,SPACE=(CYL,(200,200)),DISP=(NEW,CATLG),
// VOL=SER=(C4USS2,C4USS1),UNIT=3390,STORCLAS=SCNOSMS

The job worked fine with return code 0.

The name of the storage class is site dependent. Other storage classes may work. My ACS routine has the following.

WHEN (&DSTYPE = 'TEMP' && &SIZE < 2000001KB)     
  DO                                             
    SET &STORGRP = 'SGVIO','SGBASE','SGEXTEAV'   
    EXIT CODE(0)                                 
  END                                            

There are different sorts of Storage Groups

  • Pool – list of disks which can be used
  • VIO – when Virtual IO (paging) it to be used.

You need to pick a storage group associated with a Pool.

On minute SMS

For many people SMS is something on z/OS that gets in the way of doing real work, and you find you are trying to work around it. A bit like Clippy on Window.

SMS is System Managed Storage. Before SMS, the systems programmer would be responsible for which data sets go on which volume; how often to backup these data sets, and get annoyed when the z/OS users allocated data sets inefficiently, wasting space and using the wrong data set attributes.

SMS has made the systems programmers job much easier. Instead of having a list of disk volumes which can be used by developers, and a list of volumes reserved for systems people, then telling people which disk to use; SMS allows you to say group these volumes as SYSPROGS, and these volumes as OTHER, and when you allocate a data set the system says “COLIN.*” maps to OTHER; SYS1.* map to SYSPROGS.

You can disks have which are not SMS managed, but these days, most of the disks are SMS managed.

You can also specify rules such as all SYS1.*.PARMLIB get backed up daily – and keep the last 10 copies; and do not backup these temporary files.

The system can also do house keeping and say if these user data sets have not been used for a long period, backup them and move them to slower volumes or tape.

SMS topics

SMS has different “topics”.

A data class is used when creating a data set. It influences the space and data set attributes. You could set up a data class of USERFB80 for user data sets which are Fixed block 80 records. This data class can specify optimum block size to be used, and override any value the user has specified.

A management class provides information about how often it is to be backed up, how long it is to be kept for before automatic deletion, and if it can be compressed or moved out to tape if it has not been used for a period.

A Storage class provides information about which disk volumes to use. You may have some high performing disks, which you want databases to use, and some old spinning disks, for the end users to use.

A storage group is where data sets get created. For example storage group Pool SGCICS has volumes CICS00 through to CICS1F, storage group SGMQ has volumes SGMQS – MQ0000 through MQ004, and OLD001.

You can define a storage group which uses Virtual IO (paging), instead of disk. This is Storage Group VIO.

The Automatic Class Selection (ACS) is the magic which says “my datasets get fast disks”; “your data sets get slow disks, and the data sets are migrated out to tape if they haven’t been used for a week”. At a conceptual level it is like

if DSN in “SYS1.**” then STORCLAS = “SGSYS1”
if SIZE > 4052MB then DATACLAS= BIGFILE
Select
When(STORCLAS=”IMS”) then STORGRP = “SGIMS”
When(STORCLAS=”MQ”) then STORGRP=”SGMQ”
end

When are these visible?

I compiled a C program job. In the JCL output it had

IGD101I SMS ALLOCATED TO DDNAME (SYSLIN )
DSN (SYS22013.T150656.RA000.COLINC3.LOADSET.H01 )
STORCLAS (SCBASE) MGMTCLAS ( ) DATACLAS ( )
VOL SER NOS= VIO

So we can see the storage class used (SGBASE), and the data class, and management class (both not specified).

I’ve run out of space – but there is plenty of space.

I got the following message, and struggled to resolve the problem.

IGD17272I VOLUME SELECTION HAS FAILED FOR INSUFFICIENT SPACE FOR
DATA SET SYS21355.T163955.RA000.COLINMQ.TEMP.H01
JOBNAME (COLINMQ ) STEPNAME (S1 )
PROGNAME (AMATERSE) DDNAME (SYSUT2 )
REQUESTED SPACE QUANTITY = 415019 KB
STORCLAS (SCBASE) MGMTCLAS ( ) DATACLAS ( )
STORGRPS (SGBASE SGEXTEAV SGVIO )

SMS is clearly involved – but how to display more information? You can use ISPF ISMF panels to display information, but sometimes it is easier to use the DISPLAY SMS operator command. For example

What is the status of a volume

d sms,vol(C4USR1)
IGD002I DISPLAY SMS
VOLUME UNIT MVS   SYSTEM= 1   STORGRP NAME
C4USR1 0A9B ONRW          +   SGBASE
* LEGEND *
. THE STORAGE GROUP OR VOLUME IS NOT DEFINED TO THE SYSTEM
+ THE STORAGE GROUP OR VOLUME IS ENABLED
* - THE STORAGE GROUP OR VOLUME IS DISABLED
D THE STORAGE GROUP OR VOLUME IS QUIESCED
Q THE STORAGE GROUP OR VOLUME IS DISABLED FOR NEW ALLOCATIONS ONLY

Where the + in the line with the volume is described in the following lines. So the C4USR1 means the volume is enabled for SMS.

ONRW is ONline ReadWrite

What storage groups are defined?

D SMS,STORGRP(ALL)
D SMS,SG(SGBASE)

Gave

SGBASE POOL +
SPACE INFORMATION:
TOTAL SPACE = 16240MB USAGE% = 91 ALERT% = 0
TRACK-MANAGED SPACE = 16240MB USAGE% = 91 ALERT% = 0

if you want more information

D SMS,SG(SGBASE),LISTVOL

Gave

STORGRP TYPE SYSTEM= 1
SGBASE POOL +
SPACE INFORMATION:
TOTAL SPACE = 16240MB USAGE% = 91 ALERT% = 0
TRACK-MANAGED SPACE = 16240MB USAGE% = 91 ALERT% = 0 

VOLUME UNIT MVS SYSTEM= 1 STORGRP NAME
C4USR1 0A9B ONRW        + SGBASE
USER00 0A9C ONRW        + SGBASE
USER01                  + SGBASE
USER0A                  + SGBASE
...

There were lots of volumes defined … but only two were online and available.

Using ISMF with Storage groups

If you use

  • ISMF option 6 (Storage group)
  • Storage Group Name *
  • Option 1 (List)

This gave me

 LINE       STORGRP  SG                VIO      VIO  
 OPERATOR   NAME     TYPE              MAXSIZE  UNIT 
---(1)----  --(2)--- -------(3)------  --(4)--  (5)- 
            SGDB2    POOL              -------  ---- 
            SGEXTEAV POOL              -------  ---- 
            SGIMS    POOL              -------  ---- 
            SGMQS    POOL              -------  ---- 
            SGVIO    VIO               2000000  3390 
----------  -------- --------  ----------  ----------

We can see that the Storage Group SGVIO is of type VIO. The maximum dataset size that can be allocated in this is Storage Group. 2000000 is 2,000,000 KB.

SMS Enable/disable volumes

You can disable a volume from SMS using

V SMS,VOL(C4USR1),DISABLE

The command
D SMS,VOL(C4USR1)

now gives

VOLUME UNIT MVS    SYSTEM= 1 STORGRP NAME
C4USR1 0A9B ONRW           - SGBASE
+ THE STORAGE GROUP OR VOLUME IS ENABLED
- THE STORAGE GROUP OR VOLUME IS DISABLED

The JCL below will allocate a (temporary) data set on volume C4CFG1, and then delete it.

//IBMUSER1 JOB 1,MSGCLASS=H
//S1 EXEC PGM=IEFBR14
//DD1 DD DSN=&TEMP,DISP=(NEW,PASS),
// SPACE=(CYL,(1,1)),DCB=(LRECL=80,RECFM=FB),
// VOL=SER=(C4CFG1),
// STORCLAS=SCNOSMS
//S2 EXEC PGM=IEFBR14
//DD1 DD DSN=*.S1.DD1,DISP=(OLD,DELETE)

If I removed the STORCLAS=SCNOSMS, the data set was allocated on a different volume C4USR1 with STORCLAS (SCBASE).

Where are the definitions stored?
On my zD&T system, the ACS routines etc are defined in SYS1.S0W1.DFSMS.CNTL. I do not think SMS uses this directly. When creating definitions you may point the ISMF panels to members in this data set.