SMFEWTM — Writing SMF records

The SMFEWTM macro can be used to write records to the SMF data set. You can use this macro in any exit routine that is in supervisor state except IEFU83, IEFU84, IEFU85, IEFU86, and IEFU29 and in any application program that has APF authorization. The SMFEWTM macro verifies that SMF recording is active and allows the issuer to branch directly to SMF.

When you invoke the SMFEWTM macro, you must include the IEESMCA mapping macro, which maps the SMCA.

Note that you can also write SMF records without using a macro. See smf_record (BPX1SMF, BPX4SMF) — Write an SMF record in z/OS UNIX System Services Programming: Assembler Callable Services Reference.

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 contain a standard SMF header are then given to installation exit IEFU84 or IEFU85, as appropriate. Once exit processing is complete, the records are written to the SMF data set or log stream, unless an exit requests that the 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 SMFEWTM macro, see SMFEWTM — Write an SMF record in z/OS MVS Programming: Authorized Assembler Services Reference SET-WTO.

Return codes

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

Table 1. Return codes for the SMFEWTM 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 Start of changeor greater than 32756 bytesEnd of change, or an SMF record exit changed the length in the RDW to be less than 18 bytes Start of changeor greater than 32756 bytesEnd of change.
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, IEFU84, IEFU85, 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.
48 (X'30') The caller was not in primary ASC mode, or an incorrect ASID was encountered.
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.