- Direct Known Subclasses:
Smf100Record
,Smf101Record
,Smf102Record
Typically you would not create SmfDb2Records directly, instead create the
specific type e.g. Smf100Record
DB2 section mappings are in package com.blackhillsoftware.smf.db2.section
Processing DB2 Records
Typical steps to process DB2 records are:
- Read SMF records using the
SmfRecordReader
class - Check the record type and other relevant attributes
of each
SmfRecord
to see whether it is one you are interested in - Create the specific record type from the SmfRecord e.g.
Smf100Record.from(record)
- 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 for 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 = Smf100Record.from(record); // construct a Smf100record
// Example : process QWOS sections
for (Qwos qwos : r100.qwos()) // process 0 or more sections
{
//... // do stuff
}
}
}
// reader automatically closed at end of try with resources block
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSmfDb2Record
(byte[] data) Constructs an SmfDb2Record from the specified byte array.SmfDb2Record
(SmfRecord record) Constructs a new SmfDb2Record from an existing SMF record. -
Method Summary
Modifier and TypeMethodDescriptionDecompress the data and return a new SmfDb2Record created from the uncompressed data.static SmfDb2Record
from
(byte[] data) Constructs an SmfDb2Record from the specified byte array.static SmfDb2Record
Constructs a new SmfDb2Record from an existing SMF record.int
ifcid()
Get the IFCID from the standard headerqwha()
Get the Data Sharing header (QWHA) for this recordqwhc()
Get the Correlation header (QWHC) for this recordqwhd()
Get the Distributed header (QWHD) for this recordqwhs()
Get the standard header (QWHS) for this recordqwht()
Get the Trace header (QWHT) for this recordqwhu()
Get the CPU header (QWHU) for this recordlong
SMFDB2BUF value, with mask 0x7FFF.boolean
Return true if SMFDB2CMP bit insmfDb2seq()
is set.SMFDB2DTE as a LocalDate.int
SMFDB2DTE raw value.int
SMFDB2FLG value.int
SMFDB2LEN value.int
SMFDB2RTY value.long
SMFDB2SEQ value.int
SMFDB2SGD value.SMFDB2SID value.SMFDB2SSI value.int
SMFDB2STF value.SMFDB2TME as a LocalTime.long
SMFDB2TME raw valueboolean
Was the data used to create this DB2 SMF Record compressed using CSRCESRV?Methods inherited from class com.blackhillsoftware.smf.SmfRecord
createSection, extendedHeader, extendedHeader, getTriplet, hasSubtypes, hasSubtypes, recordLength, recordLength, recordType, recordType, sanityCheck, smfDate, smfDate, smfDateTime, smfDateTime, smfhdr1Flag, smfhdr1Iefu86, smfhdr1Len, smfhdr1Len, smfhdr1Stcke, smfhdr1StckeRawValue, smfhdr1Tzo, smfhdr1TzoRawValue, smfhdr1Version, smfhdr1Version, smfTime, smfTime, subSystem, subSystem, subType, subType, system, system
-
Field Details
-
SMFDB2CMP
public static final int SMFDB2CMPConstant: 0x80 = 128- See Also:
-
SMFDB2END
public static final int SMFDB2ENDConstant: 0x1C = 28- See Also:
-
-
Constructor Details
-
SmfDb2Record
public SmfDb2Record(byte[] data) Constructs an SmfDb2Record from the specified byte array.- Parameters:
data
- a byte array containing the SMF record data
-
SmfDb2Record
Constructs a new SmfDb2Record from an existing SMF record. The 2 records share the same data byte array.- Parameters:
record
- an existing SMF record
-
-
Method Details
-
from
Constructs a new SmfDb2Record from an existing SMF record. The 2 records share the same data byte array.- Parameters:
record
- an existing SMF record
-
from
Constructs an SmfDb2Record from the specified byte array.- Parameters:
data
- a byte array containing the SMF record data
-
decompress
Decompress the data and return a new SmfDb2Record created from the uncompressed data. Useful if you want to write the uncompressed record to a new file.- Returns:
- a SmfDb2Record without CSRCESRV compression
-
usedCompression
public boolean usedCompression()Was the data used to create this DB2 SMF Record compressed using CSRCESRV?- Returns:
- true if the record data was compressed
-
smfDb2len
public int smfDb2len()SMFDB2LEN value.- Returns:
- int SMFDB2LEN value
-
smfDb2sgd
public int smfDb2sgd()SMFDB2SGD value.- Returns:
- int SMFDB2SGD value
-
smfDb2flg
public int smfDb2flg()SMFDB2FLG value.- Returns:
- int SMFDB2FLG value
-
smfDb2rty
public int smfDb2rty()SMFDB2RTY value.- Returns:
- int SMFDB2RTY value
-
smfDb2tme
SMFDB2TME as a LocalTime.- Returns:
- LocalTime SMFDB2TME Time
- See Also:
-
smfDb2tmeRawValue
public long smfDb2tmeRawValue()SMFDB2TME raw value- Returns:
- long SMFDB2TME value
-
smfDb2dte
SMFDB2DTE as a LocalDate.- Returns:
- LocalDate SMFDB2DTE Date
- See Also:
-
smfDb2dteRawValue
public int smfDb2dteRawValue()SMFDB2DTE raw value.- Returns:
- int SMFDB2DTE value
-
smfDb2sid
SMFDB2SID value.- Returns:
- String SMFDB2SID value
-
smfDb2ssi
SMFDB2SSI value.- Returns:
- String SMFDB2SSI value
-
smfDb2stf
public int smfDb2stf()SMFDB2STF value.- Returns:
- int SMFDB2STF value
-
smfDb2seq
public long smfDb2seq()SMFDB2SEQ value.- Returns:
- long SMFDB2SEQ value
-
smfDb2cmp
public boolean smfDb2cmp()Return true if SMFDB2CMP bit insmfDb2seq()
is set.- Returns:
- boolean SMFDB2CMP bit is set in smfDb2seq()
SMFDB2CMP = 0x80
-
smfDb2buf
public long smfDb2buf()SMFDB2BUF value, with mask 0x7FFF.- Returns:
- long SMFDB2BUF value & 0x7FFF
-
ifcid
public int ifcid()Get the IFCID from the standard header- Returns:
- int IFCID value
-
qwhs
Get the standard header (QWHS) for this record- Returns:
- DB2 standard header
-
qwhc
Get the Correlation header (QWHC) for this record- Returns:
- DB2 Correlation Header or null if it is not found
-
qwht
Get the Trace header (QWHT) for this record- Returns:
- DB2 Trace Header or null if it is not found
-
qwhu
Get the CPU header (QWHU) for this record- Returns:
- DB2 CPU Header or null if it is not found
-
qwhd
Get the Distributed header (QWHD) for this record- Returns:
- DB2 Distributed Header or null if it is not found
-
qwha
Get the Data Sharing header (QWHA) for this record- Returns:
- DB2 Data Sharing Header or null if it is not found
-