You are currently on IBM Systems Media’s archival website. Click here to view our new website.

MAINFRAME > Tips & Techniques > Application Development

Processing SMF Records Using REXX

Editor’s note: This article is the third in a series exploring how to process Systems Management Facilities (SMF) data using the REXX programming language.

The previous installment of this series, "REXX Offers Tools for Automated Processing of SMF Data,” introduced a few REXX abstractions that can serve as building blocks to form the foundation of a reusable subroutine library for developing an SMF tooling. This third part of the series takes a closer look at another key concept: Variable length SMF sections within an SMF record.

Variable Length SMF Sections

If you look through the SMF record data structure definitions as described in the SMF documentation—“z/OS MVS System Management Facilities (SMF) SA22-7630”— you might notice that many SMF records contain variable length sections. To draw an analogy, you might think of variable length sections as similar to an array-based linked list (i.e., how a singly linked list might be represented using an array) but within the context of the SMF record structure.

A linked list is defined as a collection of nodes that can be traversed starting at the head node. The head is a pointer to the address of the first node of the list, and the list is traversed from one node to the next using a next pointer.

Variable length SMF sections, like array-based linked lists, have the conceptual equivalents to nodes and head pointers but not next pointers. They can be located within the SMF record, by three components, a convention called triplets. Triplet components are described in Table 1:

Table 1

Triplet Component Description Singly Linked List Analogy
Offset Offset to a particular section from the start of the SMF record Pointer to the head of the linked list or address of the first node of the list
Section length Length of the section in bytes Total number of bytes of data portions of all linked list nodes for a single section
Number of sections The number of sections Number of nodes in the linked list

The “Offset” triplet component contains the location to a specific position within the SMF record being examined. Unless otherwise specified in the section definition, no conceptual equivalent of a next pointer exists, because each data node, or section, is generally stored contiguously, one after the other. To traverse the list, one would iterate through each section using the "Number of sections" component.

To jump from one section to the next, one might take the current offset that stores the address of the first node in a section and then add the "Section length" triplet component to get the address of the start of the next section until the end of the list is reached (or the "Number of sections" component is exceeded).

However, sometimes an SMF section definition will contain a specific field that points to the offset of the next section (a next pointer if you will) so here, the "Section length" component is superfluous. For example, see the definition for the S42DSNXT field of the SMF Type 42 (DFSMS Statistics and Configuration) data set header section in the SMF documentation.

The triplet information should be checked prior to accessing a section of the record. All three fields being non-zero indicates the section exists on the record. Conversely, any of the fields being zero means the section doesn’t exist in the record. The “Number of sections” triplet field is the primary indication of the existence of the field.

George Ng is a senior certified I/T managing consultant for IBM Systems and Technology Group Lab Services at IBM Poughkeepsie. His areas of focus include z/OS Parallel Sysplex, High Availability and Performance.



2019 Solutions Edition

A Comprehensive Online Buyer's Guide to Solutions, Services and Education.

A Beginner's Guide to the REXX Programming Language on z/OS

Reading and Writing Files in the REXX programming language on z/OS.


Application Management is Important to the Entire Process


Application Testing: Giving Users What They Need

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store
Mainframe News Sign Up Today! Past News Letters