Trace Common Programming Interface (CPI) Communications (TRCCPIC) command

You can start to trace Common Programming Interface (CPI) Communications either before running a job or after a job is active to find out where the error might have occurred. The TRCCPIC command captures information about CPI-Communications calls that are processed by your program. The system collects trace information in a current job, or in a job that is serviced by a Start Service Job (STRSRVJOB) command. (For a CPI Communication program you could trace a job that is started as a result of a received program start request.) You can issue the TRCCPIC command in one of the following ways:

If you type TRCCPIC on the command line and press F4, an initial prompt is displayed for the Trace Option Setting. If *ON is specified and you press enter, the Trace CPI Communications display appears.

This display enables you to set the following parameters:

Trace option setting
Specifies whether the collection of trace information is to be started, stopped, or ended.
*ON
Starts Trace CPI Communications. This is the default value for the command.
*OFF
Stops Trace CPI Communications. The current information is written to the spooled printer file or to the database file, and the trace table. The trace information is then deleted.
*END
Ends Trace CPI Communications. The trace table and all trace information are destroyed.
Maximum storage to use
Specifies the maximum amount of storage to use for the trace information collected. The prompt appears only if you have selected *ON for the Trace option setting prompt.
200 K
The number of bytes (1 K equals 1024 bytes) of storage. This is the default value.
1-16000 K
The valid range for the maximum number of bytes used for storing collected trace information.
Trace full
Specifies whether new trace records replace old trace records or whether the trace is stopped when the maximum storage that you specified has been reached. This prompt appears only if you have selected *ON for the Trace option setting prompt.
*WRAP
When the trace storage area is full, new trace information is written over the old trace information, starting at the beginning of the storage area. This is the default value.
*STOPTRC
No new trace information is saved when the trace storage area is full. You must reissue the TRCCPIC command, specifying (*OFF) for the SET parameter, to retrieve the output of the trace information collected in the trace storage area.
User data length
Specifies the maximum length of user data to be saved for each trace record in the storage area. This prompt affects only the tracing of user data on the Send_Data and Receive calls. This parameter does not affect the tracing of log data on Set_Log_Data, Send_Error, or Deallocate calls. This prompt appears only if you specified *ON on the Trace option setting prompt.
128
The number of bytes for the user data length. This is the default value.
0-4096
The valid range of bytes for the user data length.

Trace Common Programming Interface (CPI) Communications continues to collect trace records until you stop the trace or until the trace storage area becomes full. The amount of trace storage depends on the value that is specified on the Trace full prompt. If the trace storage area becomes full and the collection of trace records stops, you must enter the TRCCPIC command again to create output. The output that is created by the TRCCPIC command is directed either to the spooled printer file, QSYSPRT, or to a database output file that you specify. If the output file that you specify already exists, it must have the same attributes as the system-supplied file, QACM0TRC.

You can stop a trace procedure in one of the following ways:

Type TRCCPIC on the command line and press F4. Specify *OFF for the Trace option setting and you are prompted for the OUTPUT parameter.