Lists transactions for which tracing is enabled.
%INCLUDE SYGWPLI;
01 IHANDLE PTR, 01 RETCODE FIXED BIN(31), 01 TRACE_TABLE_LIST(8) CHAR(08);
CALL TDLSTSPT (IHANDLE, RETCODE, TRACE_TABLE_LIST);
(I) A transaction-wide structure that contains information used to set up the Gateway-Library environment. This must be the same IHANDLE specified in the program’s initial TDINIT call. It corresponds to the context structure in Open Client Client-Library.
(O) Variable where the result of function execution is returned. Its value is one of the codes listed in Table 3-23.
(O) An array listing the contents of the trace table. Each element of this array, TRANSID_n, returns the transaction ID of a transaction for which specific tracing is currently enabled.
Under CICS: This is the TRANSID from the CICS Program Control Table (PCT).
Under IMS TM: This is the transaction name defined when the system is generated.
Under MVS: This is the APPC transaction name of the MVS transaction.
The RETCODE argument can contain any of the return values listed in Table 3-23.
Return value |
Meaning |
---|---|
TDS_OK (0) |
Function completed successfully. |
TDS_INVALID_IHANDLE (-19) |
Invalid IHANDLE specification. Error in specifying a value for the IHANDLE argument. |
TDS_INVALID_PARAMETER (-4) |
Invalid parameter value. The value assigned to one or more of the arguments supplied in the call is not valid. The operation failed. |
The following code fragment illustrates the use of TDLSTSPT to determine which transactions have tracing enabled. It returns the transaction IDs to the caller. This example is taken from the sample program in Appendix G, “Sample Tracing and Accounting Program,” which runs under CICS.
/*------------------------------------------------------------*/ INITIALIZE_PROGRAM: /*------------------------------------------------------------*/ CALL TDINIT (DFHEIBLK, GWL_RC, GWL_INIT_HANDLE); CALL TDACCEPT (GWL_PROC, GWL_RC, GWL_INIT_HANDLE, SNA_CONNECTION_NAME, SNA_SUBC); CALL TDINFRPC (GWL_PROC, GWL_RC, GWL_REQ_TYPE, GWL_RPC_NAME, GWL_COMM_STATE); IF GWL_RC NE TDS_PARM_PRESENT THEN DO; SEND_DONE = SEND_DONE_ERROR; MSG_SRVLIB_FUNC = 'TDINFRPC'; GO TO END_PROGRAM; END; /*------------------------------------------------------------*/ GET_PARM: /*------------------------------------------------------------*/ CALL TDRCVPRM (GWL_PROC, GWL_RC, GWL_RCVPRM_ID, PARM_REQUEST, TDSCHAR, GWL_RCVPRM_MAX_DATA_L, GWL_RCVPRM_DATA_L); IF PARM_REQUEST = PARM_REQUEST_INFACT THEN CALL TDINFACT_PROC; ELSE IF PARM_REQUEST = PARM_REQUEST_LSTSPT THEN CALL TDLSTSPT_PROC; /*------------------------------------------------------------*/ TDLSTSPT_PROC: PROC; /*------------------------------------------------------------*/ WRKLEN1 = STG(WRK_TRANID); WRKLEN2 = STG(CN_LSTSPT_TRANID); CTR_COLUMN = CTR_COLUMN +1; MSG_SRVLIB_FUNC = 'TDESCRIB'; CALL TDESCRIB (GWL_PROC, GWL_RC, CTR_COLUMN, TDSCHAR, WRKLEN1, WRK_TRANID, TDS_ZERO, TDS_FALSE, TDSCHAR, WRKLEN1, CN_LSTSPT_TRANID, WRKLEN2); IF GWL_RC NE TDS_OK THEN DO; SEND_DONE = SEND_DONE_ERROR; GO TO TDLSTSPT_EXIT; END; /* ------------------------------------------------------*/ /* find global status */ /* ------------------------------------------------------*/ CALL TDINFLOG (GWL_INIT_HANDLE, GWL_RC, GWL_INFLOG_GLOBAL, GWL_INFLOG_API, GWL_INFLOG_HEADER, GWL_INFLOG_DATA, GWL_INFLOG_TRACEID, GWL_INFLOG_FILENAME, GWL_INFLOG_RECORDS); /* ------------------------------------------------------*/ /* if any error, then assume tracing disabled */ /* ------------------------------------------------------*/ IF GWL_RC NE TDS_OK THEN DO; SEND_DONE = SEND_DONE_ERROR; MSG_SRVLIB_FUNC = 'TDINFLOG'; GO TO TDLSTSPT_EXIT; END; /* ------------------------------------------------------*/ /* if not specific tracing, then return nothing */ /* ------------------------------------------------------*/ IF GWL_INFLOG_GLOBAL NE TDS_TRACE_SPECIFIC_RPCS THEN GO TO TDLSTSPT_EXIT; /* ------------------------------------------------------*/ /* return rows */ /* ------------------------------------------------------*/ CALL TDLSTSPT (GWL_INIT_HANDLE, GWL_RC, GWL_LSTSPT_LIST(1)); IF GWL_RC NE TDS_OK THEN DO; SEND_DONE = SEND_DONE_ERROR; MSG_SRVLIB_FUNC = 'TDLSTSPT'; END; DOROW: DO WRK_LSTSPT_SS = 1 TO 8; WRK_TRANID = GWL_LSTSPT_LIST(WRK_LSTSPT_SS); CALL TDSNDROW (GWL_PROC, GWL_RC); IF GWL_RC NE TDS_OK THEN DO; SEND_DONE = SEND_DONE_ERROR; MSG_SRVLIB_FUNC = 'TDSNDROW'; LEAVE DOROW; END; CTR_ROWS = CTR_ROWS +1; END; /*------------------------------------------------------------*/ TDLSTSPT_EXIT: /*------------------------------------------------------------*/ RETURN; END TDLSTSPT_PROC;
TDLSTSPT lists the transactions for which specific tracing is enabled. Transaction-level tracing can be enabled for up to eight transactions.
A blank indicates that no more transactions have tracing enabled. For example, if the first four elements in the array return transaction names, and the fifth element returns a blank, you know that tracing is enabled for four transactions only, and that elements six through eight return blanks.
Transaction-level tracing occurs when the global trace flag is set off (TDS_FALSE) by TDSETLOG and one or more types of tracing are enabled. When the global trace flag is set on TDS_TRUE, all transactions are traced, whether or not individual tracing is specified for each transaction.
To determine the setting of the global trace flag and to learn what types of tracing are currently enabled, use TDINFLOG.
To determine whether tracing is turned on for a particular transaction, without listing all traced transactions, use TDINFSPT. TDINFSPT also returns the type of tracing enabled for the transaction.
TDLSTSPT retrieves information about tracing at the mainframe server, not the TRS. Tracing at the mainframe server and at the TRS are independent of each other.
See the Mainframe Connect Server Option Installation and Administration Guide for an explanation of the Gateway-Library tracing facility, instructions for using it, and the layout of the trace log.
Related functions
Related documents
Mainframe Connect Server Option Installation and Administration Guide
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |