Go to Home Page
 
Go to Home Page Go to Home Page  
Online brochure and other documentation Online brochure and other documentation
How to contact us How to contact us
Download a free 30-day trial of Spectrum Writer Download a free 30-day trial of Spectrum Writer
 
  Choose Spectrum Writer to add 4GL to your product
  Report Writer Speedup Tips Article
Spectrum SMF Writer - Low-Cost 4GL Report Writer for SMF Files.

 

This is an excerpt from the Spectrum Writer Reference Manual. But the techniques and tips discussed here all apply to the specially priced Spectrum SMF Writer product as well.

Working with SMF & RMF Records

You can use Spectrum SMF Writer to produce many useful reports from your shop's SMF files. In addition, Spectrum SMF Writer can also turn your SMF data into PC export files. This lets you work with extracted SMF data in Excel and other PC spreadsheet and database programs.

The SMF files are among the most complicated files in any shop. But Spectrum SMF Writer makes it easy to produce reports from them. Here are some specific points to keep in mind when dealing with SMF files. Some of these points are illustrated in the SMF file definition statements shown in Figure 42.

  • SMF records can be big. So to be safe, specify Spectrum SMF Writer's largest LRECL value (32,767) when defining the file. Do this in either the FILE statement or the INPUT statement. For example:

    FILE: SMF DDNAME(SMF) LRECL(32767)

    This will ensure that Spectrum SMF Writer allocates an I/O area big enough to handle the largest SMF records.

  • You should not need to specify DCB information in your DD statement. Spectrum Writer gets this information from the file's label. If you do give explicit DCB information, be sure your LRECL and BLKSIZE values are correct for the input file.
  • Spectrum SMF Writer normally ignores the 4–byte RDW (record descriptor word) at the beginning of variable–length records (such as SMF records). That is, Spectrum SMF Writer considers "column 1" of the SMF record to be the first byte after the RDW. If you prefer to include the RDW as part of the input record, specify the KEEPRDW option. Do this in either the FILE statement, the INPUT statement, or an OPTIONS statement. For example:

    FILE: SMF DDNAME(SMF) LRECL(32767) KEEPRDW

    Note: When KEEPRDW is specified, "column 1" of the SMF record becomes the first byte of the RDW. One reason you may want to specify KEEPRDW is to use the field offsets listed in the SMF manual as a guide when writing your FIELD statements. The SMF manual gives field offsets relative to the beginning of the RDW.

  • When defining fields to Spectrum SMF Writer, you can use either the COLUMN parm or the DISP (DISPLACEMENT) parm to specify where a field begins in a record. Since the SMF manual indicates field locations as offsets (displacements), it's generally more convenient to use the DISP parm in your FIELD statements.

    FIELD: REC–TYPE DISP(5) LENGTH(1) TYPE(BIN) NOACC

  • Spectrum SMF Writer has a number of date and time "data types" that are especially intended for use with SMF data. Use these in the TYPE parm of your FIELD statements to define SMF dates and times. Some common data types for SMF records are:
    P-CYYDDD This is a packed Julian date which includes a single–digit century indicator. Most SMF dates are stored in this format (written 0cyydddF in the SMF manual). Here is an example of defining a date field and then using it to select the SMF records to include in a report:

    FIELD: SMF–DATE DISP(10) TYPE(P–CYYDDD)
    INCLUDEIF: REC–TYPE = 5 AND SMF–DATE = 6/15/2007

    B-SECS This is a "binary seconds" time field. Most time–of–day and elapsed time fields in SMF records are of this type. You should specify LENGTH(4) for most SMF time fields. Also use the DEC(2) parm to indicate that the binary seconds value contains hundredths of seconds. Here is an example of defining a time field and using it to select SMF records for a report:

    FIELD: SMF–TIME DISP(6) TYPE(B–SECS) LENGTH(4) DEC(2)
    INCLUDEIF: REC–TYPE = 5 AND (SMF–TIME > 12:59:00 AND < 13:02:30)

    BIT Some SMF data is contained in bits. For example, there is a bit in type 5 records that indicates whether a job has ABENDed or not. This bit is in the byte at offset 66, and is bit number 6 under IBM's bit numbering convention. Remember that Spectrum SMF Writer numbers bits from 1 to 8 (rather than 0 to 7) from left to right. Thus the ABEND field in the type 5 record can be defined like this:

    FIELD: ABEND DISP(66) BIT(7)

    To test a bit field, just name the field in your conditional expression. For example, to include all type 5 records which completed with an ABEND, use this statement:

    INCLUDEIF: REC–TYPE = 5 AND ABEND

    You can list bit fields in your COLUMNS statement as well.

    COLUMNS: SMF–DATE SMF–TIME JOBNAME ABEND

    By default the word "ABEND" will print in the report if the bit is on, and the words "NOT ABEND" will print if the bit is off. Use the ONTEXT and OFFTEXT parms in the FIELD statement if you want to print different texts. (See an example of this on page 264.)

    When defining bit fields, keep one other thing in mind. You should explicitly specify a DISP or COLUMN parm for the first field following the bit field definition. Spectrum SMF Writer does not automatically increment the current location counter after FIELD statements for bit fields. (This is to allow you to define additional bits within the same byte.) An easy way to specify the DISP of the field following a bit field is to use DISP(*+1):

    FIELD: BIT–FIELD–A BIT(3)
    FIELD: BIT–FIELD–B BIT(7)
    FIELD: NEXT–FIELD DISP(*+1) LENGTH(5) ...

  • In general you should work with only one type of SMF record at a time. Use the INCLUDEIF statement to include only the appropriate type of records in your report. You can use additional tests to further narrow down which records are included.

    INCLUDEIF: REC–TYPE = 30 AND SMF–DATE >= 6/1/2007

  • Production SMF reports often report on "yesterday's" data. Rather than having to change the date literal in your INCLUDEIF statement for each run, you can COMPUTE yesterday's date, like this:

    COMPUTE: YESTERDAY = #INCDATE(–1, DAY)
    INCLUDEIF: REC–TYPE = 30 AND SMF–DATE = YESTERDAY

    See "Computing Dates Like "Yesterday," "Last Week", etc." on page 272 for more examples of automatically selecting date ranges bases on the system date.

  • Some SMF records are variably formatted. That is, a field may be located at one offset in one record, and at a different offset in another record of the same type. This usually occurs when the record contains segments that are repeated a variable number of times (such as one segment per DD statement in a step). Use Spectrum SMF Writer's OFFSET parm to define variably located fields. This parm is used in the FIELD statement to specify an additional offset value to use when determining where a field is located within a record. (This value is added to the COLUMN or DISP parm value.) The advantage of the OFFSET parm is that, unlike the COLUMN and DISP parms, it need not contain a constant numeric value. The OFFSET parm can be any type of numeric expression. For example, it might be something as simple as the name of a previously defined numeric field:

    FIELD: IO–OFFSET DISP(32) TYPE(FULLWORD) /* OFFSET TO ID SECTION */
    ...
    FIELD: JOBNAME DISP(0) OFFSET(IO–OFFSET) LEN(8) /*1ST ITEM IN ID SECTION*/

    Or, the OFFSET value might be a complex calculation, such as would be needed to compute the location of a field that follows a variable–length array (such as an OCCURS DEPENDING ON array) in a record. For example:

    FIELD: LAST–FIELD OFFSET(100 + (NUM–ITEMS–IN–ARRAY * ITEM–SIZE)) DISP(0) LENGTH(10)

    When using the OFFSET parm, remember that the OFFSET parm remains in effect for all subsequent FIELD statements (until a new OFFSET parm is encountered). Thus, you only need to specify the OFFSET parm for the first field in any variably–located segment. Specify OFFSET(0) if you wish to resume defining FIELDs that do not require any OFFSET value.

Figures

The figures below show some actual SMF reports produced with Spectrum SMF Writer.

(And we also have these sample SMF reports for you to check out.)


Sample SMF File Definition

SMF Record Definitions


Sample SMF Report -- Daily ABENDS

Daily ABEND Report from SMF type 30 records


Sample SMF Report -- TSO Sessions

TSO Sessions Report from SMF record type 30

 


You Can Also ...

See a SMF Completion Code Report
Copyright 2024.
Pacific Systems Group.
All rights reserved.


Spectrum Writer 4GL - the economical alternative to SAS, Easytrieve, DYL-280...

Home | Products | Prices | Documentation | 30-Day Trials | Customer Reviews | Company | FAQ | Sample Reports | SMF Records
Send Your Comments or Questions