IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Inserting statements into pgms thru REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mainfrae
Currently Banned

New User


Joined: 07 Feb 2006
Posts: 4

PostPosted: Tue Feb 07, 2006 12:31 am
Reply with quote

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
View user's profile Send private message
nuck

New User


Joined: 09 Dec 2005
Posts: 33

PostPosted: Fri Mar 17, 2006 6:16 pm
Reply with quote

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
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Fri Mar 17, 2006 7:39 pm
Reply with quote

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
View user's profile Send private message
nuck

New User


Joined: 09 Dec 2005
Posts: 33

PostPosted: Mon Mar 20, 2006 11:46 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top