Homepage    
Try it
Benefits
Features
Case Studies
Marketing Docs
Tech Corner
 
 
 

VISUAL Debugger for Windows Tech Corner
Essential for the Professional Programmer

Available editions


Printable Version

VISUAL Debugger for Windows - Essential for the Professional Programmer
TECHCORNER 3

Debugging batch jobs from the first line with VISUAL Debugger for Windows


To start debugging a running batch job is very easy with VISUAL Debugger. However, debugging a batch job from the very first line has always been complex. A trick you can use is to set a delay job (DLYJOB) command at the very beginning of the program before submitting the batch job to a job queue, but it is not the best option in many cases. However, you can start debugging batch jobs from the first line (or any line, by setting a breakpoint where you want it) by following an easy series of steps. Happy debugging!

How to debug jobs in job queues using VISUAL Debugger for Windows

1. Submit the job, and retain it in the job queue.


Click on the image to enlarge it

To retain a job in the job queue:

  • Stop the subsystem
  • Hold the job queue
  • Submit the job with the parameter “hold on job queue” (HOLD) to *YES.

Once the job has been submitted, retrieve its job name, user and number using the WRKJOBQ command (see Figure)

In this case the job is C_PGM/ROBERTO/287919

2. Start servicing the job in the JOBQ from an interactive job.
From a command line enter the following command:

STRSRVJOB JOB(number/user/name),

In our example, we should enter STRSRVJOB JOB(287919/ROBERTO/C_PGM).

3. Start VDW specifying the interactive job


Click on the image to enlarge it

Start VDW. Choose the program you want to debug and the interactive job from which you entered the STRSRVJOB command. All the debug commands will take effect on the interactive job that is servicing the job in the job queue.

Note that the job we are going to select is interactive and is the one from which the STRSRVJOB command was entered


Click on the image to enlarge it

Although VDW shows you the program source, you cannot yet set breakpoints, because the job is not active.

Note the CPF1938 error that happens if you try to set a breakpoint while the job is not active.

4. Release the job in the job queue and set the breakpoints


Click on the image to enlarge it

When you release the job, you will see the following screen appearing on the interactive screen:


Click on the image to enlarge it

This is when you can set your breakpoints in VISUAL Debugger for Windows. DO NOT PRESS [ENTER] or [F10] until you’ve finished setting your breakpoints in VDW.


Click on the image to enlarge it

When finished, release the job by pressing enter in the interactive screen.
The program has started its execution and stops on the breakpoint previously set.

 



Tango/04's new VISUAL Debugger Tech Corner is a newsletter service for customers. We'll include general debugging and programming tips, as well as new product information and advice on how to get the most out of VISUAL Debugger for Windows and related Tango/04 products.

To subscribe yourself or your friends and colleagues to the Tech Corner, just enter the email addresses that you want to subscribe below.

HTML Text

email address

If want to stop receiving VISUAL Debugger Tech Corner then you can unsubscribe at any time by sending an email with "unsubscribe" in the subject line to debug@tango04.net

 

 
© 2010 Tango/04 Computing Group_