SMF Records/SMF Type 19 Direct Access Volume

SMF Type 19 Direct Access Volume edit

SMF Type 19 Structure edit

The SMF type 19 contains data of all DASD volumes online in an LPAR during the time the SMF record is written. There is one record per volume. SMF Type 19 records are written for every processed SWITCH SMF command. This is usually once a day shortly after midnight, but could occur more often during the day, depending on your installation. Therefore it is very important to preselect the SMF dump data in the SYSIN statement of the JCL precisely to avoid processing redundant DASD data in the REXX program. In the example in the first chapter the data selection was confined to the time between midnight and one o'clock in the morning to reflect this.

The structure of the SMF type 19 record is relatively simple. It consists of just one section with the usual offsets to fields.

For more information on field values and offsets see [L1] or [L2].


SMF Record Field Values directly usable or used in the "Derived Values" Table edit

Value Description
SMF19SID System ID
SMF19VOL VOLSER
SMF19CUU UCB Number
SMF19SPC Unallocated cylinders of the volume
SMF19SPT Unallocated tracks of the volume
SMF19TRK Total tracks of the volume


Derived Values edit

Value Formula and Description
Cyls_total Cyls_total = SMF19TRK / 15

Total cylinders of the volume.
A 3390 disk volume contains 15 tracks per cylinder

GB_total GB_total = (Cyls_total * 849960) / (1024 * 1024 * 1024)

Total space of the volume in gigabyte.
A 3390 disk volume contains 56,664 bytes per track, 15 tracks per cylinder and 849,960 Bytes per cylinder

GB_free GB_free = ((SMF19SPC * 15) + SMF19SPT) * (GB_total / SMF19TRK)

Free space of the volume in gigabyte
A 3390 disk volume contains 15 tracks per cylinder

GB_alloc GB_alloc = GB_total - GB_free
Allocated space of the volume in gigabyte
DASD_Model

When SMF19TRK = 16695 then DASD_Model = '3390 Model 1'
When SMF19TRK = 33390 then DASD_Model = '3390 Model 2'
When SMF19TRK = 50085 then DASD_Model = '3390 Model 3'
When SMF19TRK = 150255 then DASD_Model = '3390 Model 9'
When SMF19TRK = 491400 then DASD_Model = '3390 Model 27'
When SMF19TRK = 982800 then DASD_Model = '3390 Model 54'
Otherwise DASD_Model = 'other'

Because we know the number of total tracks of the different 3390 DASD models, a simple select of the value of SMF19TRK is necessary to choose the right DASD model


REXX Example for SMF Type 19 edit

/*REXX-----------------------------------------------------------------
 DASD Report from SMF19 Records
 ---------------------------------------------------------------------*/
call initialize
call process_smf_data
exit 0
/*---------------------------------------------------------------------
 ---------------------------------------------------------------------*/
initialize: procedure expose __.
  __. = ''
  __.0border = copies('-',70)
  return
/*---------------------------------------------------------------------
 ---------------------------------------------------------------------*/
process_smf_data: procedure expose __.
  "CALL 'SYS1.LINKLIB(IFASMFDP)'"
  "REPRO IFILE(DUMPOUT) OFILE(WORKSMF)"
  "EXECIO * DISKR  WORKSMF ( FINIS STEM SMF."
  drop DASD_OUT.
  count = 1
  j = 1
  say date() time() "DASD Report => read " smf.0 "input records"
  /*-------------------------------------------------------------------
   -------------------------------------------------------------------*/
  do i = 1 to smf.0
     line      = smf.i
    /*-----------------------------------------------------------------
     The standard SMF record header with subtypes . . .
     We're ignoring SMFxLEN (Offset 00) and SMFxSEG (Offset 02) since
     the IDCAMS PRINT utility doesn't include the record length and
     segment descriptor fields.
     ----------------------------------------------------------------*/
    SMFxFLG = binary_b(line,offset(4),1)
    rectype = binary_d(line,offset(5),1)  /* SMFxRTY: Record type    */
    say 'Line:' right(i,6,'0') 'Record Type:' rectype
    /*-----------------------------------------------------------------
     -----------------------------------------------------------------*/
    if (rectype = 19) then do
      SMFxTME = smftime(line,offset(6),4)
      SMFxDTE = smfjdate(line,offset(10),4)
      olddate = substr(smfxdte,3,2)||,         /* YYYY.DDD in YYDDD   */
                substr(smfxdte,6,3)
      Datum   = date('S',olddate,'J')          /* Date Conversion     */
      SMF19SID = ebcdic(line,offset(14),4)    /* SMF19SID: System ID  */
      SMF19VOL = ebcdic(line,offset(20),6)    /* SMF19VOL: VOLSER     */
      SMF19CUU = binary_x(line,offset(64),2)  /* SMF19CUU: UCB Number */
      SMF19SPC = binary_d(line,offset(52),2)  /*SMF19SPC: unalloc Cyls*/
      SMF19SPT = binary_d(line,offset(54),2)  /*SMF19SPT: unalloc Trks*/
      SMF19TRK = binary_d(line,offset(124),4) /* SMF19TRK: total Trks */
      Cyls_total = SMF19TRK / 15              /* 15 Trks per Cylinder */
      select
        when SMF19TRK = 16695 then dasd_model = '3390 Model 1'
        when SMF19TRK = 33390 then dasd_model = '3390 Model 2'
        when SMF19TRK = 50085 then dasd_model = '3390 Model 3'
        when SMF19TRK = 150255 then dasd_model = '3390 Model 9'
        when SMF19TRK = 491400 then dasd_model = '3390 Model 27'
        when SMF19TRK = 982800 then dasd_model = '3390 Model 54'
        otherwise dasd_model = 'other'
      end
                                             /* 849960 Bytes per Cyl  */
      GB_total  = (cyls_total * 849960) / (1024 * 1024 * 1024)
      GBt_total = translate(GB_total,,'.',',')     /*  Point to Comma */
      GB_free   = ((SMF19SPC * 15) + SMF19SPT) * (gb_total / SMF19TRK)
      GBt_free  = translate(GB_free,,'.',',')      /*  Point to Comma */
      GB_alloc  = gb_total - gb_free
      GBt_alloc = translate(GB_alloc,,'.',',')     /*  Point to Comma */
      j=j+1
      dasd_out.j = datum||';'||SMFxTME||';'||SMF19SID||';'||SMF19VOL||,
                   ';'||SMF19CUU||';'||SMF19SPC||';'||SMF19SPT||,
                   ';'||cyls_total||';'||dasd_model||';'||gbt_free||,
                   ';'||gbt_alloc||';'||gbt_total
    /*-----------------------------------------------------------------
     -----------------------------------------------------------------*/
      count = count + 1
    end
  end
  dasd_out.0 = count
  say dasd_out.0' Records written'
  dasd_out.1 = 'DATE;TIME;SYS;VOLSER;',
               'UCB;UNALLOC CYLS;UNALLOC TRKS;TRKS TOTAL;',
               'DASD Model;GB free;GB alloc;GB total'

  "Execio * Diskw OUTDS (finis stem dasd_out."

  return
/*---------------------------------------------------------------------
 Functions: 
 here you should copy all functions from the Example in Chapter 1
 ---------------------------------------------------------------------*/
                . . . . .

Example: REXX SMF19 to create a .csv file with the values of interest

How to Extract Values from SMF Record Fields · SMF Type 70 RMF Processor Activity