External writer

If the trace is active, it is always written to an internal buffer (whose size is set to BUFSIZE during TCP/IP initialization). The internal buffer is available only in a dump of TCP/IP. Optionally, the trace can also be written to an external data set using the MVS™ CTRACE external writer. If you use an external writer, the trace records are copied to a data set.

To use an external writer, you must create a procedure that specifies the job to run (the external writer) and the trace output data sets. Also, see z/OS MVS Diagnosis: Tools and Service Aids for more information about CTRACE, the external writer (including a sample procedure), dispatching priority for the external writer job, and wrapping.

The external writer must be started before the trace can be activated. The trace must be inactivated before the writer can be stopped. The writer must be stopped before the data set can be formatted or transferred. For example, here is a sequence of commands for using an external writer procedure named ctw:
TRACE CT,WTRSTART=ctw                      
 TRACE CT,ON,COMP=SYSTCPIP,SUB=(tcpiproc)      
   R n,JOBNAME=(ezasokjs),OPTIONS=(sockapi),WTR=ctw,end        
                                            
 <run application being traced>             
                                            
 TRACE CT,OFF,COMP=SYSTCPIP,SUB=(tcpiproc)     
 TRACE CT,WTRSTOP=ctw                       
The external data set (specified in the procedure "ctw") is now available for formatting.