Black Hill Software

  • Home
  • Products
    • EasySMF
      • Release Notes and Latest Version
      • Online Manual
      • License Agreement
    • EasySMF:JE
      • EasySMF:JE Java Quickstart
      • Release Notes and Latest Version
      • Javadoc
      • EasySMF JSON Javadoc
      • License Agreement
    • 30 Day Trial
  • Purchase
    • How to Buy
    • Purchase a License
  • Support
    • EasySMF Support
    • Get the latest version of EasySMF
    • EasySMF:JE Support
    • Get the latest version of EasySMF:JE
  • News
  • Contact
    • Support
    • Sales

Java SMF API Version 1.3.0

September 7, 2016 by Andrew

Verison 1.3.0 of the EasySMF:JE Java API is now available.

Major Changes

EZSMFKEY DD

The program will now look for the key in the EZSMFKEY DD statement as well as the EASYSMFKEY environment variable. The EASYSMFKEY environment variable is no longer required for z/OS batch jobs.

API messages

API messages are now issued via the SLF4J logging framework instead of to STDOUT. This allows the destination to be customized, and avoids mixing them with program output written to STDOUT. The default destination for messages is STDERR.

SMF Section Constructors marked private

The SMF section class constructors were always documented as “intended for internal use only”. Now they are private. This allows more flexibilty in construction, which in turn allows more transparent handling of changes to sections.

Sample JCL changes

The sample JCL procedures have been modified to eliminate the extra step to concatenate user additions and changes to the environment variables. This is now done in the main program execution step.

QWHCTOKN

The DB2 Accounting Token QWHCTOKN in the Qwhc section now has its own class. It was initially unclear what type of data appeared in the QWHCTOKN. While it was frequently readable characters, it also often contained binary data. Since the purpose is presumably to match data by token, a string representation was no good because binary data might result in different tokens converting to the same String. So initially a BigInteger was chosen as a class that could uniquely represent 22 bytes of data, and be compared and used as a key etc.

However, since there is character data there, people might reasonably want to see it as a string. BigInteger doesn’t make for a simple EBCDIC to UTF8 conversion. So I created a specific class for the QWHCTOKN. Now they can be reliably compared and used as a key, and there is a custom toString() implementation that does the EBCDIC to UTF8 conversion on the character portion.

Reminder: the DB2 SMF record support is still in experimental status so there is a greater likelihood of changes to the API. In particular, while the status is experimental, improving the API is likely to take precedence over mainitaining compatibility with existing programs.

Filed Under: Java SMF Tagged With: DB2, Java

Java SMF API Version 1.2.1

July 15, 2016 by Andrew

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

Major Changes

  • Add SMF Type 121 (Java Statistics) record.

    This record has some interesting information, but has one major drawback. The ID running the Java job needs access to write SMF records. This is probably a security issue in many shops, because in general you don’t want to allow unauthorized users to write SMF records. It would be much nicer if this information was written by the JVM, without requiring special access for the user.

  • Modify samples to demonstrate use of Java 8 Streams functions. Streams are very nice for processing SMF data, and in many cases allow you to greatly simplify your code. It is unclear at the moment what the performance implications are. There are suggestions in some places that the code generated by Streams is not as well optimized as loops and iterators. That may be the case, but I don’t know yet whether the difference is detectable.

Filed Under: Uncategorized Tagged With: Java

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

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 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

EasySMF:JE Sample 1 : SMF Records by type and subtype

Systems Programmer Friendly Java

Sending Email from z/OS using Java

Sign up for EasySMF News

Stay up to date. Enter your email address to receive updates about EasySMF.
unsubscribe from list

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

  • Finding UID 0 work on z/OS using SMF Data
  • Apache Log4j CVE-2021-44228 Information
  • Java vs C++ : Drag Racing on z/OS

Twitter

My Tweets

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