SMFWTM — Writing SMF records

The SMFWTM macro is used to write records to the SMF data set. You can use this macro in any exit routine that is supervisor state except for IEFU83, IEFU84, IEFU85, IEFU86, and IEFU29, and in any application program that is APF-authorized.

All SMF records are given to installation exits before they are written to the SMF data set or log stream. If you use SMFWTM, installation exits IEFU86 and IEFU83 are invoked.

For records of all types, you must complete the record descriptor word (RDW), and the record type must be provided in the standard or extended header, in accordance with record type requirements described in the Standard and extended SMF record headers section.

Record types 0 - 127, and 1152 - 2047, which are SMF-formatted records are reserved for IBM® products. For these record types SMF supplies the date and time and system ID in the standard header, and the extended TOD clock and time zone offset in the extended header, if used.

Record types 128 - 1151 are available for user-written records. When writing these record types, you must provide all of the information in the standard header, including the date, time, and system identifier. While the system identifier can be any four-character identifier, specifying the value of the SID parameter is consistent with the system records that SMF produces. For user-written records, SMF supplies the extended TOD clock and time zone offset in the extended header, if used.

All SMF records are first given to installation exit IEFU86. Records that do not contain an extended SMF header are then given to installation exit IEFU83. Once exit processing is complete, the records are written to the SMF data set or log stream, unless an exit requests that a record is not to be written. See the documentation for those exits in z/OS® MVS Installation Exits for complete information about installing and using these exits.

For a complete description of the SMFWTM macro, see SMFWTM — Write an SMF record in z/OS MVS Programming: Authorized Assembler Services Reference SET-WTO.

Return codes

When the SMFWTM macro returns control to the caller, register 15 contains one of the following return codes.

Table 1. Return codes for the SMFWTM macro
Return code Meaning
0 (X'00') The record was written successfully.
8 (X'08') The record was not written because the length specified in the RDW was less than 18 bytes, or an SMF record exit changed the length in the RDW to be less than 18 bytes.
16 (X'10') The record was not written because SMF is not active or has ended abnormally.
20 (X'14') The record was not written because the installation-written IEFU83 or IEFU86 exit routine suppressed the record.
24 (X'18') The record was not written because the data was lost.
36 (X'24') The record was not written because the specified record type is not currently being recorded.
40 (X'28') The record was not written because a buffer shortage caused the data to be lost.
44 (X'2C') The record was not written because SMF could not establish recovery.
52 (X'34') SMF cannot write the record because of an SMF record flooding filter.
56 (X'38') The record was not written because it contains a malformed record header for an extended record type. See Generating records with extended headers in z/OS MVS System Management Facilities (SMF) for the rules for generating a record with an extended header.
60 (X'3C') The record was not written because it was modified by an installation exit (IEFU83, IEFU84, IEFU85, or IEFU86) to contain a malformed record header for an extended record type. See Generating records with extended headers in z/OS MVS System Management Facilities (SMF) for the rules for generating a record with an extended header.