Rational Developer for System z, Version 7.6

Starting Debug Tool for batch or TSO programs

This section describes how to start Debug Tool to debug programs that run in the following situations:

Starting Debug Tool for programs that start in Language Environment

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:

  1. Ensure your program has been compiled with the TEST compiler option.
  2. Ensure that the Debug Tool SEQAMOD library is in the load module search path.
    Note:
    High-level qualifiers and load library names are specific to your installation. Ask the person who installed Debug Tool the name of the data set. By default, the name of the data set ends in SEQAMOD. This data set might already be in the linklist or included in your TSO logon procedure, in which case you don't need to do anything to access it.
  3. Allocate all other data sets containing files your program needs.
  4. Allocate any Debug Tool files that you want to use. For example, if you want a session log file, allocate a data set for the session log file. Do not allocate the session log file to a terminal. For example, do not use ALLOC FI(INSPLOG) DA(*).
  5. Start your program with the TEST run-time option, specifying the appropriate suboptions, or include a call to CEETEST, PLITEST, or __ctest() in the program’s source.

Refer to the following topics for more information related to the material discussed in this topic.

Example: Allocating Debug Tool load library data set

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.

Example: Allocating Debug Tool files

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.

Starting Debug Tool in batch mode

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:

  1. Ensure that you have compiled your program with the TEST compiler option.
  2. Modify the JCL that runs your batch program to include the appropriate Debug Tool data sets and to specify the TEST run-time option.
  3. Run the modified JCL.

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.

Example: JCL that runs Debug Tool in batch mode

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=*
/*
//
Modifying the example to debug in full-screen mode

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:

Starting Debug Tool for programs that start outside of Language Environment

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.

Passing parameters to EQANMDBG

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.

Passing parameters to EQANMDBG by using only the PARM string

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:

Syntax diagram for the EQANMDBG parm string

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)'
 ...
//

Passing parameters to EQANMDBG using only the EQANMDBG DD statement

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)
/*
 ...
//

Passing parameters to EQANMDBG using the PARM string and EQANMDBG DD statement

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)
/*
 ...
//

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)