This section describes how to start Debug Tool to debug programs that run in the following situations:
Choose one of the following options to start Debug Tool under MVS in TSO:
To start Debug Tool under MVS in TSO without using DTSU, do the following steps:
Refer to the following topics for more information related to the material discussed in this topic.
The following example CLIST fragments show how you might allocate the Debug Tool load library data set (SEQAMOD) if it is not in the linklist or TSO logon procedure:
Example 1:
PROC 0 TEST
TSOLIB ACTIVATE DA('hlq.SEQAMOD')
END
Example 2:
PROC 0 TEST
TSOLIB DEACTIVATE
FREE FILE(SEQAMOD)
ALLOCATE DA('hlq.SEQAMOD') FILE(SEQAMOD) SHR REUSE
TSOLIB ACTIVATE FILE(SEQAMOD)
END
If you store either example CLIST in MYID.CLIST(DTSETUP), you can run the CLIST by entering the following command at the TSO READY prompt:
EXEC 'MYID.CLIST(DTSETUP)'
The CLIST runs and the appropriate Debug Tool data set is allocated.
The following example illustrate how you can use the command line to allocate the preferences and log files, then start the COBOL program tstscrpt with the TEST run-time option:
ALLOCATE FILE(insppref) DATASET(setup.pref) REUSE ALLOCATE FILE(insplog) DATASET(session.log) REUSE CALL 'USERID1.MYLIB(TSTSCRPT)' '/TEST'
The example illustrates that the default Debug Tool run-time suboptions and the default Language Environment run-time options were assumed.
The following example illustrates how you can use a CLIST to define the preferences file (debug.preferen) and the log file (debug.log), then start the C program prog1 with the TEST run-time option:
ALLOC FI(insplog) DA(debug.log) REUSE
ALLOC FI(insppref) DA(debug.preferen) REUSE
CALL 'MYID.MYQUAL.LOAD(PROG1)' +
' TRAP(ON) TEST(,*,;,insppref)/'
All the data sets must exist before starting this CLIST.
Choose one of the following options to start Debug Tool in batch mode:
To start Debug Tool in batch mode without using DTSU, do the following steps:
You can debug an MVS batch job in full-screen mode by choosing one of the following options:
Refer to the following topics for more information related to the material discussed in this topic.
Sample JCL for a batch debug session for the COBOL program, EMPLRUN, is provided below. The job card and data set names need to be modified to suit your installation.
//DEBUGJCL JOB <appropriate JOB card information>
//* ****************************************************************
//* JCL to run a batch Debug Tool session
//* Program EMPLRUN was previously compiled with the COBOL
//* compiler TEST option
//* ****************************************************************
//STEP1 EXEC PGM=EMPLRUN,
// PARM='/TEST(,INSPIN,,)' 1
//*
//* Include the Debug Tool SEQAMOD data set
//*
//STEPLIB DD DISP=SHR,DSN=userid.TEST.LOAD
// DD DISP=SHR,DSN=hlq.SEQAMOD
//*
//* Specify a commands file with DDNAME matching the one
//* specified in the /TEST runtime option above
//* This example shows inline data but a data set could be
//* specified like: //INSPIN DD DISP=SHR,DSN=userid.TEST.INSPIN
//*
//INSPIN DD *
STEP;
AT *
PERFORM
QUERY LOCATION;
GO;
END-PERFORM;
GO;
QUIT;
/*
//*
//* Specify a log file for the debug session
//* Log file can be a data set with LRECL >= 42 and <= 256
//* For COBOL only, use LRECL <= 72 if you are planning to
//* use the log file as a commands file in subsequent Debug
//* Tool sessions. You can specify the log file like:
//* //INSPLOG DD DISP=SHR,DSN=userid.TEST.INSPLOG
//*
//INSPLOG DD SYSOUT=*,DCB=(LRECL=72,RECFM=FB,BLKSIZE=0)
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD DUMMY
//SYSOUT DD SYSOUT=*
/*
//
The example in Example: JCL that runs Debug Tool in batch mode can be modified so that the batch program can be debugged in full-screen mode. Change line 1 to one of the following examples:
// PARM='/TEST(,INSPIN,,MFI%TRMLU001:)'
// PARM='/TEST(,INSPIN,,VTAM%USERABCD:)'
To debug an MVS batch or TSO program that has an initial program that does not run under the control of Language Environment, including non-Language Environment COBOL programs, use the Debug Tool program EQANMDBG to start Debug Tool.
If the initial program does run under the control of Language Environment and subsequent programs run outside the control of Language Environment, you can use the methods described in Starting Debug Tool for programs that start in Language Environment to debug all the programs.
To start Debug Tool by using EQANMDBG, do one of the following options:
Refer to the following topics for more information related to the material discussed in this topic.
When you modify your JCL, CLIST, or REXX EXEC to start EQANMDBG, you pass the following parameters to EQANMDBG:
You can specify these parameters in one of following ways:
Refer to the following topics for more information related to the material discussed in this topic.
The easiest way to pass parameters to EQANMDBG is to modify the PARM string to contain the name of the program to be debugged, optionally followed by any of the Debug Tool run-time options and the parameters required by your program.
The syntax for this string is:

The following table compares how a sample JCL statement might look like after you modify the PARM string:
| Original sample JCL | Modified sample JCL |
|---|---|
//STEP1 EXEC PGM=MYPROG,PARM='ABC,X(12)' ... // |
//STEP1 EXEC PGM=EQANMDBG, // PARM='MYPROG,NATLANG(UEN)/ABC,X(12)' ... // |
If the user parameter string that you are passing to your program is too long to add the necessary Debug Tool parameters to the PARM string, you can leave the PARM string unchanged and pass all required parameters to Debug Tool by using the EQANMDBG DD statement.
When you add an EQANMDBG DD statement to your JCL or allocate the EQANMDBG file in your TSO session, it can point to a data set with any RECFM (F, V, or U) and any LRECL. The data set must contain one or more lines. If it contains more than one line, all trailing blanks are removed from each line. However, each line is assumed to start in column 1 with any leading blanks considered to be part of the parameter data. Sequence numbers are not supported in this file.
The following table compares original JCL and modified JCL:
| Original JCL | Modified JCL |
|---|---|
//STEP1 EXEC PGM=MYPROG,PARM='ABC,X(12)' ... // |
//STEP1 EXEC PGM=EQANMDBG, // PARM='ABC,X(12)' //EQANMDBG DD * MYPROG, TEST(ALL,INSPIN,,MFI:*), NATLANG(ENU) /* ... // |
With this method you can put the name of the user program to be debugged as part of the PARM string, and then specify all other Debug Tool run-time options by using the EQANMDBG DD statement.
This can be desirable if you need to pass the same run-time parameters to several programs, you have room in the PARM string to add the name of the program to be debugged, but you do not have room to add all of the run-time parameters to the PARM string.
When you use this method, you must do the following:
The following table compares original JCL and modified JCL:
| Original JCL | Modified JCL |
|---|---|
//STEP1 EXEC PGM=MYPROG,PARM='ABC,X(12)' ... // |
//STEP1 EXEC PGM=EQANMDBG, // PARM='MYPROG/ABC,X(12)' //EQANMDBG DD * *,TEST(ALL,INSPIN,,MFI:*),NATLANG(ENU) /* ... // |