Oct 7 ’14

SMF: An Important Component of z/OS

by Cheryl Watson, Frank Kyne in Enterprise Tech Journal

z/OS provides more measurement data than any other operating system, which is one of the great strengths of this platform over others. These measurements allow you to tune the system, debug problems, chargeback for resources, provide management reports to show resource usage and help a capacity planner adequately forecast the future needs. The majority of this wonderful information is written to a data repository by the System Management Facilities (SMF) component. This component is used as a common receptacle of data from other components of z/OS, such as CICS and DB2.

This article provides an introduction to this most important component. A follow-up article will describe the life of an address space, how exits can be used, when type 30 records are created and how they can be used. Additional articles will include more detail on SMF, its parameters, recommendations on SMF file creation and usage, and details about the most important record types.

SMF Introduction
SMF is a base component of z/OS and has been available for more than 40 years. It provides a set of macros applications can use to pass records to SMF for recording to a data repository. The beginning of all records must conform to a standard format, and each record is identified by a one-character record type (hex value ‘00’ to ‘FF’) between 0 and 255. IBM has exclusive use of record types 0 through 127, and subsystems and applications may use 128 to 255. Applications aren’t forced to use SMF for recording and some don’t (e.g., IMS relies on its logs instead of SMF). Several of the record types also have subtypes, such as the type 30 record, which has subtypes 1 through 6 to identify unique types of records.

The basics and use of SMF are documented in the z/OS System Management Facilities (SMF) manual (see the “Resources” section at the end of this article).

The major elements of SMF are:

Uses of SMF Data
These disciplines make heavy use of SMF data:

- Tuning devices, jobs, network, data sets and workload manager (WLM)
- Managing and reporting resources such as CPU, external storage, memory and connections
- Configuration analysis
- Management reporting
- Problem identification
- Hardware and workload analysis

Major Record Types
Everyone should be familiar with the major SMF records, but if you’re new to SMF, here’s a shortcut:

            - Subtype 1 is written at the beginning of a job.
            - Subtype 2 is written at the end of all but the last interval (if the INTERVAL keyword of the SMFPRMxx parmlib member is turned on).
            - Subtype 3 is written at the end of the last interval of a step (if the INTERVAL keyword of the SMFPRMxx parmlib member is turned on).
            - Subtype 4 is written at the end of a step.
            - Subtype 5 is written at the end of a job.
            - Subtype 6 is written at the end of an interval for a system task.

If these are on the tip of your tongue, you will be considered an expert!

SMF Flow
The SMF address space is started at IPL and runs as a SYSTEM task. Figure 1 shows the flow of SMF data through the system:

1. Applications use macros to pass records to the SMF writer (i.e., SMF address space).
2. The SMF writer uses parameters from the SMFPRMxx member(s) in SYS1.PARMLIB to determine which records to keep, which to discard and which exits to call. It then stores the records in a buffer.
3. Records are written from the buffer to either VSAM data sets formatted especially for SMF or to one or more SMF Logger logstreams (but not both).
4. The installation runs a program to extract the records from the data sets or logstream to create sequential files. The IBM-supplied program is IFASMFDP (for VSAM data sets) or IFASMFDL (for logstream data).
5. The SMF sequential files are used as input to a variety of programs and are often stored on databases. MXG from Merrill Consultants, CA-MICS, ITRM from SAS and the IBM Tivoli Decision Support (TDS) System are the most common databases.

SMF VSAM Data Sets
VSAM data sets are the traditional and most common location for SMF records when they’re written by the SMF address space to a device. These data sets must be pre-formatted, and there are multiple data sets so that if one is being dumped, SMF may switch to another data set for recording the records. When an SMF VSAM data set fills, SMF calls the IEFU29 exit and switches to another formatted VSAM data set. The exit usually issues a message to the operator and submits a job (most commonly IFASMFDP) to dump the records to a sequential data set and clear and format the dumped VSAM data set.

There are several problems with SMF VSAM data sets:

SMF Logger
To resolve some of the problems just defined, IBM provided an option in z/OS 1.9 to write SMF records to a logstream instead of a VSAM data set. This is now the recommended method of recording SMF data and resolves many of the previous problems.

With SMF Logger, SMF records are written to a logstream that resides in a Coupling Facility structure or on DASD (a DASDONLY logstream). CF logstreams allow multiple LPARs in a sysplex to record to the logstream, so you could have a single, sysplexwide repository of SMF records, for example. Also, to provide better scalability and more flexibility, you can have multiple SMF logstreams; for example, one for RMF, another for DB2, another for security records and so on. This allows a higher write rate and lets you reduce the post-processing time (multiple offload jobs at the same time).

The use of SMF logstreams can avoid these problems because:

We strongly recommend that installations use the SMF Logger, even if it’s recording to a DASDONLY logstream. You will need to spend a little time on migration because some of your procedures will need to be changed, but the benefits far outweigh the effort. For more information, see the SMF Logger Redbook in the “Resources” section.

SMFPRMxx
The SYS1.PARMLIB member called SMFPRMxx defines the types of SMF records that are recorded. It also provides all the options used by SMF during its processing. It’s an important Parmlib member, although it’s seldom modified once it’s created. SMFPRMxx is processed at IPL and is pointed to by the IEASYSxx parameter of “SMF=xx”, where “xx” is the suffix of SMFPRMxx. If no reference is made, SMFPRM00 is assumed.

General SMFPRMxx recommendations:

A future article will describe each parameter and our recommendations.

Resources
The primary SMF manual is the z/OS MVS System Management Facilities (SMF). This provides the record layouts, exits, macros and several recommendations on using the SMF files:

The z/OS MVS Initialization and Tuning Reference manual describes all the SMFPRMxx Parmlib parameters:

A wonderful Redbook on the SMF Logger is SMF Logstream Mode—Optimizing the New Paradigm (SG24-7919). Also, you can find a summary of SMF record types in our SMF Reference Summary at www.watsonwalker. com/references.html.