You are on page 1of 11

Debugging in Mainframe using Tracemaster

Author(s): (1) divya_manjari Written On: 05/24/04 Dec aration I/We hereby declare that this document is based on our personal experiences and / or experiences of my/our project members. To the best of our knowledge, this document does not contain any material that infringes the copyrights of any other individual or organi ation including the customers of Infosys. divya_manjari !roject Detai s : !rojects Involved " #I$%&'() )ardware W!latform " I*+ $&/,-. &oftware /nviornment " +0&,(I(&,(obol,0&1+,2(# !roject Type " +aintenance "ar#et readers : $ey%ords: mainframe,($*$#,(I(&,debugging,Tracemaster,tools &ntroduction: T31(/+1&T/3 is a tool for debugging and testing ($*$# and assembler sources in mainframe. This document explains the step by step procedure for debugging the (I(& program in (I(& and the cobol program in foreground mode. All mainframe users

How to Debug a COBOL/CICS program using Tracemaster

De'u##in# a (O)O*/(&(+ ,ro#ram in (&(+ 4. 5. ,. 6. 8. (ompile and link the program for trace master #oad the programs and symbol files through (I(& Trace master menu &et the breakpoints 3un the transaction and 7ebug #og off

7ebugging a ($*$# batch program 9in :oreground; 4. (ompile and link the program for trace master 5. &et 7efault libraries ,. &et symbol library and (onvert the 2(# 6. 3un in debug mode

Debugging a COBOL/CICS program in CICS

STE ! Compile an" lin# t$e program for trace master < :irst of all we need to do some preparation for testing the program in Tracemaster.We need to create a symbol file for Tracemaster. )ence, for running a program using Tracemaster, the program needs

to be compiled in a modified manner. The 2(# ,!rocedure or macros for compilation needs to undergo following changes" o (hange the program for compilation I='(3(T# >T..0&(5 9(obol II; I?:(*#.. >T...&(* 9$&/0& (obol; 1dd symbol library

o o

prefix.symbol.library9program name) 1dd trace master load library


prefix.>T3/&#I* < It should be trace master load library name specified during installation.

E%ample" The existing macro for compiling a cobol program has following step" //($* />/( !=+@I='(3(T#, //&T/!#I* 77 7&%@&'&4.&I='($+!,7I&!@&)3 // 77 7&%@&'&!.##.(I(&T&55.(I(&.&7:)#$17,7I&!@&)3 The above step is changed as follows for compiling a program to be tested in Tracemaster. //($* />/( !=+@&T''(SC) //&T/!#I* DD DS*+S,ST- D-T.ACEMST-(/!''M-&T.ESLIB0DIS +SH. // 77 7&%@&'&4.&I='($+!,7I&!@&)3 //S,MO1T DD DS*+TST!-2OODLIO*-S,MBOL-LIB.A.,34MEM450 // DIS +SH. STE ) Loa" t$e programs an" s6mbol files t$roug$ CICS Trace master menu < 1fter compiling and linking the program, following steps needs to be followed to load the program " o do a new copy of the program in (I(& screen. o Type the transaction I7 for Tracemaster on (I(& &creen.7efault is >>T..

o When you are entering the Tracemaster menu for the first time, go to
A!3$:I#/B option and set the symbol library9prefix.symbol.library CDsame

as in compilation procedure;.1lso set the 7isplay format as A(B9character;.&ave and exit to Tracemaster main menu.

%ow go to A&/TE!B option and enter F($*$#G command

o #oad the program by entering #$17 command followed by program name


to be tested. /.g. #$17 I%0$H.4.1fter successful load following msg would appear .

#oad the symbol files using the command >&'+*$#& followed by the program name.:or e.g. >&'+*$#& I%0$H.4.$n successful load the program would be displayed on the screen.

STE 7 Set t$e brea#points < 1fter loading the program, set the breakpoints in the program, wherever reIuired. It can be done in following ways !lace the cursor on line and press !:46 *! line number *! Paragraph name In the following screen shots two breakpoints are set.

STE / .un t$e transaction an" Debug 8 %ow the program is ready for debugging. (ome out of Tracemaster menu 9use exit, not #ogCoff; and type the transaction id to run the program to be tested. 1fter the encounter of first break in the program the Tracemaster screen would be displayed. :rom here you can execute the program in debugging mode.'ou can press !:4 and use the help for !: keys and commands to be used.&ome of the basic functionalities" :or executing line by line use !:45.

3un/conditional run by !:4. To see the value of a variable, place the cursor on it and press !:J

STE 9 Log off < /nter A1bendB command to terminate the program 1bend x9any arbitrary character; A/ndB command would only return back to the trace master menu. 3emember to log off from trace master to free the resources

Debugging a COBOL batc$ program 3in 2oregroun"5


STE ! Compile an" lin# t$e program for trace master < It would be same as that for (I(& program. 'ou need to make same changes in the compilation 2(# procedure. STE )

Set Default libraries < $pen trace master menu by typing AT&$ T3+1&TB command or using I&!: options9 :or example"option 1.4J from I&!: panel brings the Tracemaster menu;

:irst time users should set the default libraries using option .9$!TI$%&;on the menu.1&3,profile and macros libraries are mandatory. :or setting a library enter the corresponding number ahich would display the following screen.

)ere enter the dataset name as Aprefix.>T1&3B or simply >T1&3. If the Iuotes are dropped, the prefix would be the default prefix. The default prefix could be changed using option 49=eneral $ptions; which is by default your userid. If the dataset does not exist then a screen for new dataset creation would appear"

'ou need to fill in the reIuired information.1fter setting all the libraries, the libraries would be shown in current library definitions.

STE 7 Set s6mbol librar6 an" Con:ert t$e ;CL < %ow go back to the main menu and enter the option for foreground testing.

)ere select option 89&ymbols; and give the symbol library name9same as used in the compilation 2(#;

1fter setting the symbol library use option , for converting the 2(# which executes the program for Tracemaster.&pecify the member and the !7& and press enter to get the following screen.

It would list all the steps of the 2(#. &elect the program to be debugged by putting & in front of the step executing the program and press !:,. STE /

.un in "ebug mo"e < " %ow press option 4. 93un Test; to run the program in debug mode.The screen with source code would be displayed.

)ere, you can set the breakpoints and start executing the program by pressing !:45 or typing 3E% command on command line. $ther options are same as those in (I(&. 1fter the testing is over, exit by typing A/%7B command.

You might also like