View previous topic :: View next topic
|
Author |
Message |
mainfrae Currently Banned New User
Joined: 07 Feb 2006 Posts: 4
|
|
|
|
Hi all
My requirement is like , i am having a cobol program with some errors.To identify the errors , i will make use of display statements to see what value is moving into variables etc. So now instead of writing display statement in all places,Is there any way to insert display statements into the corresponding lines of a program through REXX? If possible ,sent me the sample code please.
Thanks
sundkum |
|
Back to top |
|
|
nuck
New User
Joined: 09 Dec 2005 Posts: 33
|
|
|
|
read up on how to create edit macros in the REXX docs, then write yourself a 'cobdisp' and a 'dcobdisp' .... basically an edit macro that searches for where you want your displays to be inserted (eg. after section names to indicate entry) and then inserts them. I've done this before with CLISTs, so it must be possible with rexx. |
|
Back to top |
|
|
martin9
Active User
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
|
|
|
|
hy mainfrae,
of course you could do it that way,
but you are much faster, if you code
the displays directly into yout program.
what you can do also:
on the line with the display command, make a D
in position 7 and give in your identification
division DEBUG, then after compiling you get
these displays. without DEBUG the compiler
neglects the displays...
*** DEBUGGING MODE ***
Debugging mode is specified by adding the WITH DEBUGGING MODE clause to
the SOURCE-COMPUTER paragraph of the CONFIGURATION SECTION.
Debugging mode works in conjunction with special debugging lines coded
within the source program. A line is considered to be a debugging line
if it contains a 'D' in the indicator area (column 7).
When WITH DEBUGGING MODE is specified, each debugging line is compiled
(i.e., included in the object program as if it were a normal
statement). When WITH DEBUGGING MODE is not specified, debugging lines
are syntax checked but are not compiled into the object program.
Debugging lines can be used, for example, to check the value of a given
data item at certain points within the program.
Debugging lines can be placed anywhere within a program after the
SOURCE-COMPUTER paragraph.
martin9 |
|
Back to top |
|
|
nuck
New User
Joined: 09 Dec 2005 Posts: 33
|
|
|
|
remember to be careful with using 'DEBUG MODE' - if you put code that changes variable values with a 'D' in col. 7, then you might end up with a program that works perfectly in test, but bombs when the debugging mode is turned off (and yes, this is someone who is speaking from experience!)
For example, the site that I am currently on does not allow debug mode - some of the people here have never even heard of it.
ralph |
|
Back to top |
|
|
|