CICS and Batch DB2 Identifiers

(Originally posted 2015-09-30.)

DB2 Accounting Trace names are a(n endless) [1] source of fascination to me.

As many of you know, bridging the gap between DB2 and callers and the environment is permanently an imperative for me. These names might be cryptic but they can usually be related to non-DB2 concepts. As I’m about to explain this to colleagues at work I thought I might as well explain it to the world (or at least my readership). So here goes.

(Note: I explained this for IMS Batch in Finding The DB2 Accounting Trace Records For an IMS Batch Job Step but now I want to do it for non-IMS Batch and CICS.)[2]

DB2 Accounting Trace (SMF 101) has three fields of particular interest, which behave differently depending on the type of working coming into DB2.

  • Connection Type (QWHCATYP) – a 1-byte integer
  • Connection Name (QWHCCN) – a 8-byte character string
  • Correlation ID (QWHCCV) – a 12-byte character string

Here’s a diagram, illustrating these 3 fields and how they behave for Batch (like) and CICS connection types.

Connection Type tells you which style of connection the SMF 101 refers to. For example TSO, BATCH, DB2CALL, CICS, DDF. [3]

Connection Name is interesting for CICS: It’s the CICS region name.

Correlation ID is interesting for CICS and for Batch, but each is differently treated:

  • For CICS the middle 4 bytes are the CICS Transaction ID.[4]
  • For Batch the first 8 bytes are the Job name.

By the way Connection Types “TSO”, “DB2 Call”,“Utility” and “Batch” are often Batch, regardless of what they look like. They just represent different ways of getting to into DB2 from a batch job step.

I think I’ll add a slide for this to my “DB2 Through My Eyes” Presentation.

Oh, and this is just Batch and CICS. DDF has even more information in the QMDA and QLAC sections. Perhaps I should write about that some time.

  1. 25 years so far, but who’s counting? 🙂  ↩

  2. I discussed the CICS DB2 Connection briefly in He Picks On CICS  ↩

  3. Constant-value symbols are defined in the mapping macro for each supported type. For example QWHCCICS.  ↩

  4. The first four are strings such as “POOL” and “ENTR”, telling you what kind of CICS / DB2 Connection thread this is. The last four are the commit number.  ↩

Published by Martin Packer

I'm a mainframe performance guy and have been for the past 35 years. But I play with lots of other technologies as well.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: