CICS and IMS SDK

The CICS and IMS SDK supports customer-specific tagging that uses either standard Dynatrace tags or customer-supplied custom tags. The SDK also provides APIs that let you add nodes to an existing PurePath and associate arguments and return values with them. This SDK is part of the CICS and IMS code modules. It requires no additional license.

The SDK supports all common z/OS languages.

Each API returns an integer value to indicate failure, or zero to indicate success. See the list of return codes below.

DTSTUB provides access to ADK functions. Add a DD statement and an INCLUDE to the binder step to include it in your program. For example:

//SZDTLOAD  DD  DISP=SHR,DSN=_hlq_.SZDTLOAD

...

  INCLUDE SZDTLOAD(DTSTUB)

Include API function declarations (C and PL/I only)

zos/sdk/0-include-pli.pl1
Download
%INCLUDE DTADKPLI;

You can download and use these include and sample files:

API naming conventions

Each function name starts with DT, followed by characters that define the purpose of the function and an optional suffix that indicates the argument type.

 DTaaaabb
 ^ ^   ^
 | |   `- Parameter type:
 | |       - 'TN'  text - null terminated string
 | |       - 'TP'  text - PL/I string
 | |       - 'TF'  text - fixed length string
 | |       - 'A'   byte array
 | |       - 'S'   16-bit signed integer
 | |       - 'I'   32-bit signed integer
 | |       - 'L'   64-bit signed integer
 | |
 | `-- Method type:
 |      - 'SP'   Start PurePath
 |      - 'SLP'  Start linked PurePath
 |      - 'SCLP' Start linked PurePath with custom tag
 |      - 'IL'   Insert link
 |      - 'ICL'  Insert link with custom tag
 |      - 'IAL'  Insert asynchronous link
 |      - 'IACL' Insert asynchronous link with custom tag
 |      - 'EP'   End PurePath
 |      - 'EN'   Enter
 |      - 'EX'   Exit
 |      - 'EXEX' Exit with exception
 |      - 'DC'   Data capture
 |
   `---- 'DT' prefix

Start PurePath

Start a new CICS or IMS PurePath that is unrelated to any existing PurePath.

Note that CICS LINKs, CICS STARTs, and IMS program to program message switches initiated by the transaction being traced automatically create their own linked subpaths.

zos/sdk/1-start-purepath-cobol.cbl
Download
CALL "DTSP" RETURNING RC.
CALL "DTSPTF" USING FIXED_LEN_STRING, LENGTH, CCSID RETURNING RC.

Parameters

c_string PurePath name specified as a null-terminated string.
pli_string PurePath name specified as a PLI varying string.
fixed_len_string PurePath name specified as a fixed-length string with an explicit length.
length Length of the specified fixed-length string.
ccsid Coded character set identifier for the string. Specify a value of zero (0) to use the CICS or IMS region's default code page.

Start linked PurePath

Start a CICS or IMS PurePath that is a continuation of another PurePath, typically in response to an inbound service request from another platform.

Note that CICS LINKs, CICS STARTs, and IMS program to program message switches initiated by the transaction being traced automatically create their own linked subpaths.

zos/sdk/2-start-linked-purepath-cobol.cbl
Download
CALL "DTSLPA" USING BINARYTAG, LENGTH RETURNING RC.
CALL "DTSCLPA" USING CUSTOMTAG, LENGTH RETURNING RC.
CALL "DTSLPTF" USING FIXED_LEN_STRING, LENGTH RETURNING RC.

Parameters

binarytag Standard binary tag specified as a byte array.
customtag Custom tag specified as a byte array.
c_string Standard string tag specified as a null-terminated string.
pli_string Standard string tag specified as a PLI varying string.
fixed_len_string Standard string tag specified as a fixed-length string with an explicit length.
length Length of the specified fixed-length string or byte array. Note that this is the length of the tag, not the buffer.

End PurePath

Terminate the current PurePath created by a Start PurePath or Start Linked PurePath API.

The End PurePath API may not be required because the PurePath ends automatically at the end of the transaction, or when another Start PurePath or Start Linked PurePath API is used in the same transaction to trace another input message. End PurePath should be used before a long running transaction waits for another input message to arrive.

When used, End PurePath must be issued by the same transaction that issued the Start PurePath or Start Linked PurePath, regardless of CICS LINKs, CICS STARTs, or IMS program to program message switches which create their own linked subpaths automatically, which are independent of the SDK.

zos/sdk/3-end-purepath-cobol.cbl
Download
CALL "DTEP" RETURNING RC.

Parameters

None

Link the current PurePath to another PurePath, typically in response to an outbound request from the CICS or IMS application to a server on another platform.

The string or array used with these APIs returns a new tag that is sent with the outbound request, but DTICLA requires the caller to supply a custom tag.

Parameters

binarytag Standard binary tag returned as a byte array (output).
customtag Custom tag specified as a byte array (input).
c_string Standard string tag returned as a null-terminated string (output).
pli_string Standard string tag returned as a PLI varying string (output).
fixed_len_string Standard string tag returned as a fixed-length string with an explicit length (output).
length Length of the supplied byte array (input).
tag_buffer_len Length of the supplied buffer that is used to return the new tag (input).

Also used as an output parameter by DTILA and DTILTF to return the actual length of the returned array or string.

Link the current PurePath to another PurePath, typically in response to an outbound request from the CICS or IMS application to a server on another platform.

This feature is very similar to the Insert link with important difference that it inserts links for outbound requests that do not necessarily operate in a synchronous manner.

The string or array used with these APIs returns a new tag that is sent with the outbound request, but DTIACLA requires the caller to supply a custom tag.

Parameters

binarytag Standard binary tag returned as a byte array (output).
customtag Custom tag specified as a byte array (input).
c_string Standard string tag returned as a null-terminated string (output).
pli_string Standard string tag returned as a PLI varying string (output).
fixed_len_string Standard string tag returned as a fixed-length string with an explicit length (output).
length Length of the supplied byte array (input).
tag_buffer_len Length of the supplied buffer that returns the new tag (input). Also used as an output parameter by DTIALA and DTIALTF to return the actual length of the returned array or string.

Enter node

Add a node to the currently active CICS or IMS subpath to indicate the execution start of a new program or activity.

The number of Exit node and Exit node with exception APIs must equal the number of Enter node APIs. Subpaths with unbalanced numbers of enter and exit APIs are marked as corrupted.

Typically, this API is used by the program calling the named program but it could also be issued at the beginning of the called program. The Enter node API returns a 32-but integer token that must be saved so it can be specified on the associated Exit node or Exit node with exception API.

zos/sdk/6-enter-node-cobol.cbl
Download
CALL "DTENTF" USING FIXED_LEN_STRING, LENGTH, TOKEN RETURNING RC.

Parameters

c_string Program name specified as a null-terminated string.
pli_string Program name specified as a PLI varying string.
fixed_len_string Program name specified as a fixed-length string with an explicit length.
length Length of the specified fixed-length string.
token A 32-bit binary integer token used to associate this node with the corresponding Exit node (output).

Exit node

Indicate that the program or activity associated with the most recent Enter node API has ended.

Each Exit node or Exit node with exception API pairs with the most recent Enter node API. Subpaths with unbalanced numbers of enter and exit APIs are marked as corrupted.

Related Enter node and Exit node APIs should be issued by the same program in most cases. This is so an exit does not attempt to end a node associated with a program with its own node due to a LE call, CICS LINK, or IMS program to program message switch invoked since the most recent Enter node API.

zos/sdk/7-exit-node-cobol.cbl
Download
''CALL "DTEX" USING TOKEN RETURNING RC.

Parameters

token The 32-bit integer token that was returned by the most recent Enter Node API that hasn't issued Exit node or Exit node with exception.

Exit node with exception

Indicate that the program or activity associated with the most recent Enter node API ended with an error.

Each Exit node or Exit node with exception request pairs with the most recent Enter node request. Subpaths with unbalanced numbers of enter and exit APIs are marked as corrupted.

Related Enter node and Exit node APIs should be issued by the same program in most cases. This is so an exit does not attempt to end a node associated with a program with its own node due to a LE call, CICS LINK, or IMS program to program message switch invoked since the most recent Enter node API.

zos/sdk/8-exit-node-exception-cobol.cbl
Download
CALL "DTEXEX" USING TOKEN RETURNING RC.

Parameters

token The 32-bit integer token that was returned by the most recent Enter node API that hasn't issued Exit node or Exit node with exception.

Data capture

Provide an argument capture value for a subsequent Enter node API, or the return value for a subsequent Exit node or Exit node with exception API.

Multiple Data capture APIs may be issued before an Enter node API to capture entry arguments, but only one return value may be associated with an Exit node or Exit node with exception API.

An Enter node, Exit node, or Exit node with exception API should always immediately follow one or more Data capture APIs to prevent the captured value being unintentionally associated with another node.

zos/sdk/9-data-capture-cobol.cbl
Download
CALL "DTDCS" USING INT16_VALUE RETURNING RC.
CALL "DTDCI" USING INT32_VALUE RETURNING RC.
CALL "DTDCL" USING INT64_VALUE RETURNING RC.
CALL "DTDCTF" USING FIXED_LEN_STRING, LENGTH, CCSID RETURNING RC.

Parameters

c_string Capture value specified as a null-terminated string.
pli_string Capture value specified as a PLI varying string.
fixed_len_string Capture value specified as a fixed-length string with an explicit length.
length Length of the specified fixed-length string.
ccsid Coded character set identifier for the string. Specify a value of zero (0) to use the CICS or IMS region's default code page.
int16_value A 16-bit signed binary value such as a COBOL PIC S9(5) COMP, PLI FIXED BIN 15. C short int, or assembler halfword.
int32_value A 32-bit signed binary value such as a COBOL PIC S9(9) COMP, PLI FIXED BIN 31. C int, or assembler fullword (F).
int64_value A 64-bit signed binary value such as a COBOL PIC S9(18) COMP, PLI FIXED BIN 63. C long long int, or assembler doubleword (FD).

API return codes

All APIs return an integer value.

Return Code API Types Action Description
0 All As documented Success
4 Start PurePath

Start linked PurePath
None A PurePath is already in progress for this transaction.
4 Data capture

Enter node

Exit node

Exit node with exception

End PurePath

Insert link

Insert asynchronous link
None No PurePath is in progress for this transaction at this time.
8 End PurePath None A different sensor started the PurePath that is in progress for this transaction.
8 Start linked PurePath None The specified tag's format is invalid or the specified string length doesn't match the actual string tag length.
8 Insert link

Insert asynchronous link
None The supplied buffer is too small to hold the tag.
8 Exit node

Exit node with exception
None The supplied token is not valid.
12 Start PurePath None The specified PurePath name is too long.
12 Start linked PurePath

Start linked PurePath with custom tag

Insert link with custom tag

Insert asynchronous link with custom tag
None The specified tag length is negative or too long.
12 Data capture None The specified capture string is too long (currently limited to 200 bytes).
12 Enter node None The specified node name is too long (currently limited to 8 bytes).
16 Start linked PurePath None A dummy tag was specified.
2000 All Correct calling program A program check occurred in the CICS or IMS instrumentation while handling an SDK API. This is presumably caused by an incorrect argument.

Negative return codes

A negative return code generally indicates that the CICS or IMS instrumentation is not available, so the application program should continue on the assumption that tracing isn't being performed.

In a CICS environment, the CICS DFHRMCAL interface passes SDK requests to the CICS code module's task related user exit (TRUE). DFHRMCAL returns undocumented negative values such as -2 if the CICS instrumentation is not active. If negative return codes are encountered, you can use the DTAX transaction to see whether the CICS instrumentation is enabled.

In an IMS environment, a negative return code also indicates that the IMS instrumentation is not available. Return code -1 means the IMS instrumentation is not installed in this IMS subsystem. Return code -4 means the IMS instrumentation is installed but has been disabled. Return code -5 indicates that the installation process is not completed in this dependent region. Return code -5 is expected if the SDK starts a PurePath in the first transaction to execute after the message region starts or the IMS instrumentation is enabled. Initialization may take a second or two, so this condition may occur for more than one transaction at startup.

If the SDK returns negative return codes while other transactions in the affected dependent region are traced successfully, please contact a Dynatrace ONE product specialist by clicking the chat button in the upper-right corner of the Dynatrace menu bar.

API notes

The CICS and IMS SDK supports COBOL, PL/I, Assembler, and C/C++. PL/I and C provide include members that declare the API functions.

COBOL programs must specify a type such as PIC S9(9) that corresponds to a binary fullword for integer variables such as RC, LENGTH (not a valid COBOL variable name), CCSID, and TAG_BUFER_LEN. Array or string variables can be declared as PIC X(##).

All character string values assume the default EBCDIC code page of the CICS or IMS region unless the API accepts an explicit CCSID override.

The binary tag length is 30 bytes and a string tag may be up to 79 bytes. The tag_buffer_len specifying the area length to hold an output tag argument must be set as follows:

  • DTILA and DTIALA API—30 or more.
  • DTILTF and DTIALTF API—79 or more.
  • DTILTN and DTIALTN API—80 or more to allow for a null terminator byte.
  • DTILTP and DTIALTP API—81 or more to allow for the halfword string length.

It is recommended that code that handles standard string tags should support tags that are significantly larger than the minimum sizes above to minimize compatibility issues with future extended tag formats.

Input string arguments other than tags are currently limited to a maximum length of 200 bytes. This limit does not include the two byte length of a PLI varying string or the null terminator byte of a null terminated string, just the text contents of the string.