Producing a CTRACE

  1. Optional (when using CTRACE writer): Create a member in SYS1.PROCLIB to allocate CTRACE writer data sets. Run the following example job to create a member called CTWDASD, which allocates one data set for the CTRACE writer to write to. Change the data set name as appropriate. Use more space if available (suggest CYL (15,5)).
    //PROCLIB  JOB ,
    //      TIME=(,30),MSGCLASS=Z,MSGLEVEL=(1,1)
    //*
    //* CREATE PROC MEMBER FOR TRACE WRITER
    //*
    //STEP0 EXEC PGM=IEBGENER,REGION=1024K
    //SYSPRINT DD SYSOUT=*
    //SYSUT2 DD DSN=SYS1.PROCLIB(CTWDASD),DISP=SHR
    //SYSUT1 DD DATA,DLM=EE
    //WTRJCL  PROC
    //*
    //*   PROC FOR WRITER
    //*
    //CTWDASD  EXEC PGM=ITTTRCWR,TIME=5
    //SYSPRINT  DD SYSOUT=A
    //* if you have the dasd, allocate more space
    //TRCOUT01  DD DSN=IBMUSER.TRACE.WRITER,
    //          UNIT=SYSDA,SPACE=(CYL,(5,2)),
    //          DISP=(,CATLG)
    //*TRCOUT02  DD DSN=IBMUSER.TRACE.WRITER1,
    //*          UNIT=SYSDA,SPACE=(CYL,(5,2)),
    //*          DISP=(,CATLG)
    EE
    //SYSIN DD DUMMY
    /*                                       
  2. Optional (when specifying options using a PARMLIB member): Create a PARMLIB member to specify your trace options:
    //CTISMS01 JOB ,
    //   TIME=(,30),MSGCLASS=A,MSGLEVEL=(1,1)
    //*
    //*  WTR(CTWDASD)
    //*
    //STEP0 EXEC PGM=IEBGENER,REGION=1024K
    //SYSPRINT DD SYSOUT=*
    //SYSUT2 DD DSN=SYS1.PARMLIB(CTISMS01),DISP=SHR
    //SYSUT1 DD *
    TRACEOPTS ON
         WTR(CTWDASD)
         OPTIONS=('ENTRY,EXIT,EXITA,SPECIAL,CB')
    /*
    //SYSIN DD DUMMY
    /* 
  3. Optional (only to use CTRACE writer): Start the trace writer which allocates the trace data sets (so that the trace buffers are written, rather than wrapped):

    TRACE CT,WTRSTART=CTWDASD

    You get the following:

    10.43.51           IEE839I ST=(ON,0016K,00016K) AS=ON  BR=OFF EX=ON
    MT=(ON,024K)
       ISSUE DISPLAY TRACE CMD FOR SYSTEM AND COMPONENT TRACE STATUS
    
    10.43.53           ICH408I JOB(MSTJCL00) STEP(ASCH    )
    LOGON/JOB INITIATION - USER AT TERMINAL          NOT RACF-DEFINED
    10.43.53           IRR012I  VERIFICATION FAILED. USER PROFILE NOT FOUND
    
    10.43.54           AHL906I THE OUTPUT BLOCK SIZE OF    23476 WILL BE USED
    FOR OUTPUT
       DATA SETS:
       IBMUSER.TRACE.WRITER
    10.43.54           ITT110I INITIALIZATION OF CTRACE WRITER CTWDASD
    COMPLETE.  
    Activate trace with a PARMLIB member to specify options:

    TRACE CT,nnnK,COMP=PFS,PARM=CTISMS01

    where CTISMS01 has all the options you intend to trace, and 'nnnK' is the trace buffer size.

    Or activate trace and specify options with response:

    TRACE CT,500K,COMP=PFS

    Note:
    1. 500 K is the recommended trace table size if the CTRACE writer is used
    2. Use a larger size if CTRACE writer is not used, for example 4 M
    3. Buffer size range 72 K - 64 M
    4. Smaller buffer size causes frequent spooling to CTRACE writer queue
    5. Larger buffer size causes more paging

    Reply with the trace options:

    Rxx,JOBNAME=OMVS,OPTIONS=(ENTRY,EXIT,EXITA,SPECIAL,CB,
    COMP=(PFS)),wtr=ctwdasd,end

  4. The following message indicates that you entered the command correctly:
     10.53.21           ITT038I ALL OF THE TRANSACTIONS REQUESTED VIA THE
     TRACE CT COMMAND WERE SUCCESSFULLY EXECUTED.
     10.53.21           IEE839I ST=(ON,0016K,00016K) AS=ON  BR=OFF EX=ON
     MT=(ON,024K)
        ISSUE DISPLAY TRACE CMD FOR SYSTEM AND COMPONENT TRACE STATUS
  5. To display what you have just set up, enter the following:

    DISPLAY TRACE,COMP=PFS

    The following is displayed:
    10.51.51           IEE843I 10.51.50  TRACE DISPLAY 077
         SYSTEM STATUS INFORMATION
     ST=(ON,0016K,00016K) AS=ON  BR=OFF EX=ON  MT=(ON,024K)
     COMPONENT     MODE BUFFER HEAD SUBS
     --------------------------------------------------------------
     PFS           ON   0072K
                   ASIDS      *NONE*
                   JOBNAMES   *NONE*
                   OPTIONS    ENTRY,EXITA
                   WRITER     CTWDASD
  6. Run your testcases.
  7. Take a console dump to include the trace buffers that have not yet been written to the trace data sets. If a dump results as part of the recreate, this step is not necessary.

    DUMP COMM=(your dump title)

  8. Reply with the OMVS address space name and dataspace name:

    R xx,SDATA=(CSA,SQA,LSQA,PSA,RGN,TRT),CONTR

    R xx,JOBNAME=OMVS,DSPNAME='OMVS'.HFSDSP01,END

  9. Terminate or Disconnect Trace:

    Disconnecting the trace retains all of your current trace options. Terminating the trace requires that you respecify the trace options if you restart the trace. Disconnect if you would like to redirect trace data to a new CTRACE writer data set.

    Terminate the trace:

    TRACE CT,OFF,COMP=PFS

    Or

    Disconnect the trace:

    TRACE CT,500K,COMP=PFS (Where 500 K is any size you choose)

    Respond with: R #,WTR=DISCONNECT,END

  10. Terminate the trace writer:

    TRACE CT,WTRSTOP=CTWDASD,FLUSH

    FLUSH writes the spooled trace data. Note that trace records not already spooled to the CTRACE writer queue are not written to the CTRACE writer data set.

  11. Send both the dump and the trace data sets to IBM® Level-2 support

    A dump is necessary, either because the recreate took a dump or you took one from the console to get the trace buffers that were not flushed to DASD.

  12. To view the trace under IPCS

    To view the writer data set:
    set defaults (option 0) dsname('ibmuser.trace.writer')
    under commands (either option 4 or 6)
    CTRACE comp(syssms) full local

    To view trace buffers in dump, assuming dump is sys.dumpxx:
    set defaults (option 0) dsname('sys1.dumpxx')
    under commands (either option 4 or 6)
    CTRACE comp(syssms) full local