Turns on or off system-wide accounting for Gateway-Library. Under CICS, rename the CICS accounting log.
%INCLUDE SYGWPLI;
01 IHANDLE PTR, 01 RETCODE FIXED BIN(31), 01 ACCOUNTING_FLAG FIXED BIN(31), 01 ACCOUNTING_FILENAME CHAR(08), 01 MAXNUM_TRACE_RECORDS FIXED BIN(31);
CALL TDSETACT (IHANDLE, RETCODE, ACCOUNTING_FLAG, ACCOUNTING_FILENAME, MAXNUM_ACCT_RECORDS);
(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-28.
(I) Accounting on/off indicator. Assign this argument one of the following values:
TDS_TRUE (1) |
Turn on accounting. |
TDS_FALSE (0) |
Turn off accounting. |
(I) Name of the accounting log.
Under CICS: Specify the DATASET name from the CICS File Control Table (FCT) entry that describes the VSAM file used for this log. As installed, this name is SYTACCT1. You can change the name of this log by specifying a new name here.
Under IMS TM and MVS: Leave this field blank. IMS TM and MVS ignore this value.
(I) Accounting log record limit.
Under CICS: This is the maximum number of records to be allocated for this accounting file. To indicate the system maximum, assign this argument a value of -1. We recommend always setting this value to -1.
Under IMS TM: The IMS TM system log does not have a limit. We recommend always using -1.
Under MVS: Use -1. The size of the log is determined by the space allocated to the sequential file used as the MVS log.
The RETCODE argument can contain any of the return values listed in Table 3-28.
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. |
TDS_LOG_ERROR (-258) |
Attempt to write to the log file failed. |
The following code fragment receives a request to turn accounting off, checks that accounting is on, and uses TDSETACT to turn it off. This example is based on the sample program in Appendix G, “Sample Tracing and Accounting Program,” which runs under CICS.
/*---------------------------------------------------------------*/ 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_SETACT_OFF THEN CALL TDSETACT_OFF_PROC; /*---------------------------------------------------------------*/ TDSETACT_OFF_PROC: PROC; /*---------------------------------------------------------------*/ CALL TDINFACT (GWL_INIT_HANDLE, GWL_RC, GWL_INFACT_STATUS, GWL_INFACT_FILENAME, GWL_INFACT_RECORDS); IF GWL_RC NE TDS_OK THEN DO; SEND_DONE = SEND_DONE_ERROR; MSG_SRVLIB_FUNC = 'TDINFACT'; GO TO TDSETACT_OFF_EXIT; END; /* ------------------------------------------------------------*/ /* Turn off host accounting, if it’s on. */ /* ------------------------------------------------------------*/ IF GWL_INFACT_STATUS = TDS_TRUE THEN DO; CALL TDSETACT (GWL_INIT_HANDLE, GWL_RC, TDS_FALSE, GWL_INFACT_FILENAME, GWL_INFACT_RECORDS); IF GWL_RC NE TDS_OK THEN DO; SEND_DONE = SEND_DONE_ERROR; MSG_SRVLIB_FUNC = 'TDSETACT'; GO TO TDSETACT_OFF_EXIT; END; END; /*--------------------------------------------------------------*/ TDSETACT_OFF_EXIT: /*--------------------------------------------------------------*/ RETURN; END TDSETACT_OFF_PROC;
You use this function to begin recording accounting information in the accounting log, to stop recording after it began, or, under CICS, to change the name of the accounting log.
This function returns accounting information recorded at the mainframe server. The TRS administrator can turn local accounting recording on and off at the TRS. Accounting at the mainframe and at the TRS are independent of each other.
Gateway-Library accounting records the total number of TDS bytes, packets, messages, rows, requests, and cancels sent and received at the mainframe server from the time a TDACCEPT function initializes the TDS environment until a TDFREE is issued, and the number of seconds and milliseconds that elapsed during the conversation.
The accounting flag is set to off when Gateway-Library is initialized. It remains off until the program explicitly turns it on with TDSETACT; then it remains on until the program explicitly turns it off with TDSETACT. No other Gateway-Library functions turn accounting on or off.
If a transaction does not call this function, the accounting flag remains in the state it was in before the transaction executed.
TDSETACT opens the specified accounting log when it turns accounting recording on.
The IMS TM system log is always open, but TDSETLOG does
a logical OPEN by turning accounting on.
Accounting information is written to the accounting log after TDFREE is issued.
The log used for accounting depends upon the transaction processing system in use:
Under CICS: The accounting log is a VSAM ESDS file known to CICS as SYTACCT1.
You can use this function to change the name of the accounting log as long as the name you specify matches an FCT DATASET entry. An alternate log may already exist—an FCT entry for the alternate log SYTACCT2 is included in the installation instructions.
When the log fills up, you must explicitly empty or delete the log or specify an alternate log in the ACCOUNTING_FILENAME argument.
Under IMS TM: The accounting log is the IMS TM system log. For more information on this log, see your IMS TM documentation.
Under MVS: The log file is a sequential file (usage is optional).
See the Mainframe Connect Server Option Installation and Administration Guide for an explanation of the Gateway-Library accounting facility, instructions for using it, and the layout of the CICS accounting log.
Related functions
Related Documents
Mainframe Connect Server Option Installation and Administration Guide