TDSETACT

Description

Turns on or off system-wide accounting for Gateway-Library. Under CICS, rename the CICS accounting log.

Syntax

COPY SYGWCOB.
01 IHANDLE             PIC S9(9)  USAGE COMP SYNC.
01 RETCODE             PIC S9(9)  USAGE COMP SYNC.
01 ACCOUNTING-FLAG     PIC S9(4)  USAGE COMP SYNC.
01 ACCOUNTING-FILENAME PIC X(8)   VALUE IS SPACES.
01 MAXNUM-ACCT-RECORDS PIC 9(9)   USAGE COMP SYNC.
CALL 'TDSETACT’ USING IHANDLE, RETCODE, 
               ACCOUNTING-FLAG, ACCOUNTING-FILENAME,
                MAXNUM-ACCT-RECORDS. 

Parameters

IHANDLE

(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.

RETCODE

(O) Variable where the result of function execution is returned. Its value is one of the codes listed in Table 3-28.

ACCOUNTING-FLAG

(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.

ACCOUNTING-FILENAME

(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.

MAXNUM-ACCT-RECORDS

(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. Sybase recommends always setting this value to -1.

Under IMS TM: The IMS TM system log does not have a limit. Sybase recommends 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.

Returns

The RETCODE argument can contain any of the return values listed in Table 3-28.

Table 3-28: TDSETACT return values

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.

Examples

Example 1

In the following code fragment, the program receives a request to turn accounting on, uses TDINFACT to check that accounting is off, then uses TDSETACT to turn accounting on. This example is based on the sample program in Appendix G, “Sample Tracing and Accounting Program.” which runs under CICS.

*    Accept client request
     CALL 'TDACCEPT' ... 
* ----------------------------------------------------------------
  GET-PARM. 
* ----------------------------------------------------------------
      CALL 'TDRCVPRM' USING GWL-PROC, GWL-RC, 
                            GWL-RCVPRM-ID, PARM-REQUEST, TDSCHAR, 
                            GWL-RCVPRM-MAX-DATA-L, 
                            GWL-RCVPRM-DATA-L. 
     IF PARM-REQUEST-INFACT THEN 
            PERFORM TDINFACT THRU TDINFACT-EXIT 
     ELSE IF PARM-REQUEST-SETACT-ON THEN 
            PERFORM TDSETACT-ON THRU TDSETACT-ON-EXIT 
*    Request was to set accounting on.
*---------------------------------------------------------------- 
  TDSETACT-ON. 
*---------------------------------------------------------------- 
      CALL 'TDINFACT' USING GWL-INIT-HANDLE, GWL-RC, 
                            GWL-INFACT-STATUS,
                            GWL-INFACT-FILENAME,
                            GWL-INFACT-RECORDS. 
 
      IF GWL-RC NOT = TDS-OK THEN 
            MOVE 'N' TO SEND-DONE-SW 
            MOVE 'TDINFACT' TO MSG-SRVLIB-FUNC 
            GO TO TDSETACT-ON-EXIT 
      END-IF. 
*    Turn on mainframe accounting. 
     CALL 'TDSETACT' USING GWL-INIT-HANDLE, GWL-RC, 
                            TDS-TRUE, GWL-INFACT-FILENAME, 
                            GWL-INFACT-RECORDS. 
      IF GWL-RC NOT = TDS-OK THEN 
            MOVE 'N' TO SEND-DONE-SW 
            MOVE 'TDSETACT' TO MSG-SRVLIB-FUNC 
            GO TO TDSETACT-ON-EXIT 
      END-IF.
*----------------------------------------------------------------
  TDSETACT-ON-EXIT. 
*----------------------------------------------------------------
     EXIT. 

Usage

See also

Related functions

Related documents