TDSETLOG

Description

Sets system-wide tracing for the mainframe server and rename the CICS trace log.

Syntax

% INCLUDE SYGWPLI;
01 IHANDLE               PTR,
01 RETCODE               FIXED BIN(31),
01 GLOBAL_TRACE_FLAG     FIXED BIN(31),
01 API_TRACE_FLAG        FIXED BIN(31), 
01 TDS_HEADER_TRACE_FLAG FIXED BIN(31),
01 TDS_DATA_TRACE_FLAG   FIXED BIN(31),
01 TRACE_ID              FIXED BIN(31),
01 TRACE_FILENAME        CHAR(08) INIT('  '),
01 MAXNUM_TRACE_RECORDS  FIXED BIN(31);
CALL TDSETLOG	(IHANDLE, RETCODE, GLOBAL_TRACE_FLAG,
	 API_TRACE_FLAG, TDS_HEADER_TRACE_FLAG,
	 TDS_DATA_TRACE_FLAG, TRACE_ID,
                 TRACE_FILENAME, MAXNUM_TRACE_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-31.

GLOBAL_TRACE_FLAG

(I) Global or specific trace indicator. Use this argument to turn tracing on or off and to indicate whether tracing is global (trace all transactions) or applies to a specific set of transactions. If tracing is off, only errors are logged.

Specific tracing can be set for 1 through 8 transactions. To set tracing for a particular transaction, use TDSETSPT.

Assign this argument one of the following values:

TDS_NO_TRACING (0)

Turn off all tracing.

TDS_TRACE_ALL_RPCS (1)

Turn on global tracing.s

TDS_TRACE_SPECIFIC_RPCS (2)

Turn on specific tracing.

TDS_TRACE_ERRORS_ONLY (3)

Log errors only.

API_TRACE_FLAG

(I) API tracing on/off indicator. This is a Boolean value that sets tracing on or off for Gateway-Library calls. Assign this argument one of the following values:

TDS_TRUE (1)

Turn on API tracing.

TDS_FALSE (0)

Turn off API tracing.

TDS_HEADER_TRACE_FLAG

(I) TDS header tracing on/off indicator. This is a Boolean value that sets tracing on or off for TDS headers. Assign this argument one of the following values:

TDS_TRUE (1)

Turn on header tracing.

TDS_FALSE (0)

Turn off header tracing.

TDS_DATA_TRACE_FLAG

(I) TDS data tracing on/off indicator. This is a Boolean value that sets tracing on or off for TDS data. Assign this argument one of the following values:

TDS_TRUE (1)

Turn on data tracing.

TDS_FALSE (0)

Turn off data tracing.

TRACE_ID

(I) The trace entry identifier.

Under CICS: This is the tag for the auxiliary file entry.

Under IMS TM and MVS: Leave this field blank. This argument is ignored.

TRACE_FILENAME

(I) Name of the trace/error 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 SYTDLOG1. 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_TRACE_RECORDS

(I) Trace log record limit.

Under CICS: This is the maximum number of records to be allocated for this trace file. To indicate the system maximum, assign this argument a value of -1. We recommend always using -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.

Returns

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

Table 3-31: TDSETLOG 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

The following example illustrates the use of TDSETLOG to enable API tracing and header tracing. It is taken from the sample program in Appendix G, “Sample Tracing and Accounting Program,” which runs under CICS.

	/*------------------------------------------------------------------*/ 
	      TDSETLOG_ON_PROC: PROC; 
	/*------------------------------------------------------------------*/ 
          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 GWL_RC NE TDS_OK THEN 
          DO; 
              SEND_DONE       = SEND_DONE_ERROR; 
              MSG_SRVLIB_FUNC = 'TDINFLOG'; 
              GO TO TDSETLOG_ON_EXIT; 
          END; 
  /*      ------------------------------------------------------------*/ 
  /*      turn on API (CICS Aux Trace) and Header tracing             */ 
  /*      ------------------------------------------------------------*/ 
          CALL TDSETLOG (GWL_INIT_HANDLE, GWL_RC, 
                         TDS_TRACE_ALL_RPCS, 
                         TDS_TRUE, 
                         TDS_TRUE, 
                         GWL_INFLOG_DATA, 
                         GWL_INFLOG_TRACEID, 
                         GWL_INFLOG_FILENAME, 
                         GWL_INFLOG_RECORDS); 
  
          IF GWL_RC NE TDS_OK THEN 
          DO; 
              SEND_DONE       = SEND_DONE_ERROR; 
              MSG_SRVLIB_FUNC = 'TDSETLOG'; 
              GO TO TDSETLOG_ON_EXIT; 
          END; 
  
  /*------------------------------------------------------------------*/ 
  TDSETLOG_ON_EXIT: 
  /*------------------------------------------------------------------*/ 
          RETURN; 
  
  END TDSETLOG_ON_PROC; 

Example 2

The following example illustrates the use of TDSETLOG to disable API tracing and header tracing. It is taken from the sample program in Appendix G, “Sample Tracing and Accounting Program,” which runs under CICS.

	/*------------------------------------------------------------------*/ 
	TDSETLOG_OFF_PROC: PROC; 
	/*------------------------------------------------------------------*/ 
          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 GWL_RC NE TDS_OK THEN 
          DO; 
              SEND_DONE       = SEND_DONE_ERROR; 
              MSG_SRVLIB_FUNC = 'TDINFLOG'; 
              GO TO TDSETLOG_OFF_EXIT; 
          END; 
  /*      ------------------------------------------------------------*/ 
  /*      turn off API (CICS Aux Trace) and Header tracing            */ 
  /*      ------------------------------------------------------------*/ 
          CALL TDSETLOG (GWL_INIT_HANDLE, GWL_RC, 
                         TDS_NO_TRACING, 
                         TDS_FALSE, 
                         TDS_FALSE, 
                         GWL_INFLOG_DATA, 
                         GWL_INFLOG_TRACEID, 
                         GWL_INFLOG_FILENAME, 
                         GWL_INFLOG_RECORDS); 
  
          IF GWL_RC NE TDS_OK THEN 
          DO; 
              SEND_DONE       = SEND_DONE_ERROR; 
              MSG_SRVLIB_FUNC = 'TDSETLOG'; 
              GO TO TDSETLOG_OFF_EXIT; 
          END; 
  /*------------------------------------------------------------------*/ 
  TDSETLOG_OFF_EXIT: 
  /*------------------------------------------------------------------*/ 
          RETURN; 
  
  END TDSETLOG_OFF_PROC;

Usage


TDSETLOG

You use this function to turn on or off one or more kinds of tracing, and to specify whether tracing is global or for specific transactions only. The following kinds of tracing are supported:

Trace flag

Global trace flag

Trace log

Tracing at the mainframe server

See also

Related functions

Related documents