Black Hill Software

  • Home
  • Products
    • EasySMF
      • Online Manual
      • Release Notes and Latest Version
      • License Agreement
    • EasySMF:JE
      • EasySMF:JE Java Quickstart
      • Release Notes and Latest Version
      • Javadoc
      • License Agreement
    • EasySMF:RTI
      • EasySMF:RTI – SMF Real Time Interface
      • Javadoc
    • 30 Day Trial
  • Purchase
    • How to Buy
    • Purchase a License
  • Support
    • Documentation
      • EasySMF Desktop Online Manual
      • EasySMF:JE Javadoc
      • EasySMF RTI Javadoc
      • EasySMF JSON Javadoc
      • z/OS Utilities Javadoc
    • EasySMF Support
    • Get the latest version of EasySMF
    • EasySMF:JE Support
    • Get the latest version of EasySMF:JE
  • News
  • Contact
    • Support
    • Sales

Java API for DB2 SMF Records

May 19, 2016 by Andrew

Version 1.2.0 of the EasySMF:JE Java API is now available.

Major Changes

  • SMF Type 89 Support
  • SMF type 42 Support
  • DB2 SMF type 100 and 101 support

Java API for DB2 SMF Records

This support is currently experimental while we learn more about the specifics of DB2 SMF data. Breaking changes to the API are more likely while it is in experimental status.

Using the API

Typical steps to use the package are:

  1. Read SMF records using the SmfRecordReader class
  2. Check the record type and other relevant attributes of each SmfRecord to see whether it is one you are interested in
  3. Create the specific record type from the SmfRecord e.g. new Smf100Record(record)
  4. Process information from the specific record as required
DB2 Record Compression

Records compressed with CSRCESRV will be automatically expanded when the SmfDb2Record is constructed.

IFCID

The IFCID of the record can be determined using the SmfDb2Record.ifcid() method.

Accessing Record Data

DB2 records are typically made up of a varying number of sections of different types. Sections of a specific type are returned in a List<E> of that type. If there are no sections of the type in the record an empty List is returned. This allows you to iterate over the sections without explicitly checking whether the sections exist in the record – an empty list will iterate 0 times. However, you may need to check the IFCID if the section is present in multiple IFCIDs but you want data from a specific IFCID.

Example

The following code reads all Qwos sections from type 100 SMF records from the DD INPUT.

 try (SmfRecordReader reader = 
         SmfRecordReader.fromDD("INPUT").include(100))  // include only type 100 records
 {
     for (SmfRecord record : reader)                    // read each record
     {
         Smf100Record r100 = new Smf100Record(record);  // construct a Smf100record
         for (Qwos qwos : r100.qwos())                  // process 0 or more Qwos sections
         {
             //...                                      // process Qwos sections here
         }
     }
 }                                                      // reader automatically closed at end
                                                        // of try with resources block.

Of course the inner loop can be replaced with whatever processing you need to do with the record.

Data Conversion

The API aims to provide a consistent interface across different types and sections, and converts values to standard Java types for simple programming. Conversions are the same as for other SMF record types.

Dates and Times

Dates and times are converted to java.time classes. Java.time can represent dates and times with a precision of 1 nanosecond.

  • Times representing a duration e.g. CPU or elapsed time are converted to Duration.
  • Dates and times of day are converted to LocalDate, LocalTime, LocalDateTime or ZonedDateTime depending on exactly what information is in the field. Typically, times based on UTC(GMT) are converted to ZonedDateTime with ZoneOffset.UTC. Other dates and times are converted to LocalDate/Times.
    Java has time zone rules so it is possible to apply a ZoneId to a LocalDateTime and perform date aware conversions between time zones.

The raw numeric value of date and time fields is also provided.

Numeric Values
  • 1, 2 and 3 byte integer values and 4 byte signed integer values are converted to int (32 bit signed) values.
  • 4-7 byte integer values and 8 byte signed values are converted to long (64 bit signed).
  • 8 byte unsigned values are available as both long (64 bit signed) and as a BigInteger. The long value may provide better performance if the value will not exceed the maximum value for a long. If a value does exceed the maximum value (i.e. the high order bit is set) an exception will be thrown.
    If the field value might exceed the maximum value for a long, use the BigInteger version.
  • Integer values greater than 8 bytes are converted to BigInteger.
  • Floating point values are converted to Java double.

Filed Under: Uncategorized

z/OS Productivity Tools using Java

August 11, 2015 by Andrew

This article examines how Java can be a powerful productivity tool for a Systems Programmer, using the task of synchronizing Master Catalogs as an example.

[Read more…]

Filed Under: Java

Systems Programmer Friendly Java

August 11, 2015 by Andrew

This article describes how to set up a simple environment for running Java batch reports or utilities, including JCL PROCs similar to the compile and go PROCs that come with other languages.

[Read more…]

Filed Under: Java

Processing z/OS SMF data using Java

November 4, 2014 by Andrew

Black Hill Software is currently developing an API for processing SMF data using Java.

The API builds on experience gained developing EasySMF to create a powerful and easy to use API for working with SMF data.

The API will run on z/OS and other platforms such as Linux and Windows. The API is 100% Java which makes it zAAP eligible on z/OS.

[Read more…]

Filed Under: Java SMF

EasySMF:JE Installation

November 4, 2014 by Andrew

[Read more…]

Filed Under: Java SMF

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • Next Page »

30 Day Trial

EasySMF and EasySMF:JE are available for a free 30 day trial. Download now and start using them immediately.
30 Day Trial

Information

EasySMF:JE Java API for SMF: Quickstart

Java vs C++ : Drag Racing on z/OS

News

  • Using zEDC compression for SMF data
  • Text message alerts using the z/OS SMF Real Time Interface
  • DCOLLECT Reports and DCOLLECT to JSON using Java

Black Hill Software

Suite 10b, 28 University Drive, Mt Helen, VIC 3350, Australia
PO Box 2214, Bakery Hill, VIC 3354, Australia
+61 3 5331 8201
+1 (310) 634 9882
info@blackhillsoftware.com

News

  • Using zEDC compression for SMF data
  • Text message alerts using the z/OS SMF Real Time Interface
  • DCOLLECT Reports and DCOLLECT to JSON using Java

Copyright © 2025 · Enterprise Pro Theme on Genesis Framework · WordPress · Log in