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

Option for tracking code during compiling


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Abhushan_s

New User


Joined: 28 Jul 2008
Posts: 34
Location: Ahmedabad

PostPosted: Mon Mar 02, 2009 11:57 am
Reply with quote

Hi all,

Actually i have a COBOL code in a package and i was having some difficulty in Debugging that code, I wanted to get the whole flow of the program once the job starts its execution and calls the program (code). Its a real big code, so there was no way out except using DISPLAY statements wherever i thought i could find a track of the code and crack it icon_smile.gif , fortunately i have found the solution for it, but i just wanted to know if there are any kind of an options in changeman where we can get an option for tracking out code during compiling it? I mean we might save time in putting down the DISPLAY statements after every para?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Mar 02, 2009 12:24 pm
Reply with quote

Hi,

No, AFAIK, Changeman does not provide any such facility. I use a REXX, ADDISP, for this purpose, check if that works for you:
Code:
/* REXX */                                                             
/*                                           */                       
/* Displays the paragraph names in a cobol pgm /     
/* It works if the edit mode is NUM ON STD or NUM OFF             */   
/*                                           */                       
/*TRACE ?I*/                                                           
ISREDIT MACRO                                                         
ADDRESS ISREDIT  "F 'PROCEDURE DIVISION' 8 FIRST"                     
ADDRESS ISREDIT  "F P'¬' 8"                                           
DO UNTIL RC > 0                                                       
   ADDRESS ISREDIT  "(THELINE) = LINE .ZCSR"                           
   IF  POS("EXIT",THELINE) = 0 ,                                       
   &   POS("*",THELINE) = 0 ,                                         
   &   POS("-INC",THELINE) = 0 ,                                       
   &   POS("COPY",THELINE) = 0                                         
   THEN                                                               
     DO                                                               
       PARSE VAR THELINE NUM  " " LINE1 "." LINE2                     
       LINE3 = STRIP(LINE1,'L'," ")                                   
/*     LINE3 = "FJGNL - "LINE3           */                           
   ADDRESS ISREDIT "LINE_AFTER .ZCSR = '           DISPLAY '"LINE3"''"
     END                                                               
   ADDRESS ISREDIT  "F P'¬' 8"                                         
END                                                                   
First, try it on some "test-component".
Back to top
View user's profile Send private message
Abhushan_s

New User


Joined: 28 Jul 2008
Posts: 34
Location: Ahmedabad

PostPosted: Mon Mar 02, 2009 12:27 pm
Reply with quote

Hey Thank you Anuj for the help,

but iam not having any prior knowledge of REXX icon_lol.gif . Anyways will try it out with someone knowing it.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Mar 02, 2009 1:39 pm
Reply with quote

Hi,

At my shop we are not allowed to promote a code to production with those many DISPLAYs - you should delete them (unless they are allowed at your end in production) once you are done with debugging. Here is other REXX, which I use for deleting those DISPLAYs added with the above REXX:
Code:
/* REXX */                                           
/* DELETES THE DISPLAY LINES ADDED BY ADDISP MACRO */
/*TRACE ?I*/                                         
ISREDIT MACRO                                         
ADDRESS ISREDIT  "F 'PROCEDURE DIVISION' 8 FIRST"     
ADDRESS ISREDIT  "F P'¬' 8"                           
DO UNTIL RC > 0                                       
   ADDRESS ISREDIT  "(THELINE) = LINE .ZCSR"         
   IF  POS("EXIT",THELINE) = 0 ,                     
   &   POS("*",THELINE) = 0 ,                         
   &   POS("-INC",THELINE) = 0                       
   THEN                                               
     DO                                               
                                                     
       ADDRESS ISREDIT "(CURLINE,CURCOLM) = CURSOR"   
       CURLINE = CURLINE + 1                         
       ADDRESS ISREDIT "CURSOR = " CURLINE CURCOLM   
       ADDRESS ISREDIT  "(DISLINE) = LINE .ZCSR"     
       IF  POS("DISPLAY",DISLINE) <> 0 ,             
       THEN                                             
          DO                                             
             ADDRESS ISREDIT  "(HERE) = CURSOR"         
             ADDRESS ISREDIT  "LABEL " HERE " = .CURRENT"
             ADDRESS ISREDIT  "DELETE .CURRENT"         
          END                                           
                                                         
     END                                                 
   ADDRESS ISREDIT  "F P'¬' 8"                           
END                                                     
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: USA

PostPosted: Mon May 04, 2009 2:55 pm
Reply with quote

Hi Anuj,

While executing the second Macro (DELETES THE DISPLAY LINES ADDED BY ADDISP MACRO) em gettingan Error.

16 +++ CURLINE = CURLINE + 1
IRX0041I Error running DEDISP, line 16: Bad arithmetic conversion


Can you get me, where em going wrong.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 04, 2009 3:16 pm
Reply with quote

if you have no debuggers in your shop,
use:

SOURCE COMPUTER WITH DEBUG.
column 7 D (and code a display in the line.)

will compile the code to include those lines with D in 7

after you have finished debugging, instead of deleting all the display lines

change SOURCE COMPUTER WITH DEBUG.
to SOURCE COMPUTER.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon May 04, 2009 9:19 pm
Reply with quote

See the Language Reference manual for the correct syntax of the SOURCE-COMPUTER paragraph. The way I code this is:
Code:
      *UNCOMMENT THE FOLLOWING LINE TO ENABLE DEBUGGING MODE
      *SOURCE-COMPUTER.  IBM-ZOS WITH DEBUGGING MODE.

This allows me to enable/disable debugging mode very easily.
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: USA

PostPosted: Tue May 05, 2009 10:13 am
Reply with quote

I've tried it and its working fine..

Thanks for your replies..
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue May 05, 2009 5:37 pm
Reply with quote

balukanna wrote:
I've tried it and its working fine..
I believe, now I don't need to answer your PM, which is asking the same thing . . . icon_smile.gif
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: USA

PostPosted: Tue May 05, 2009 6:26 pm
Reply with quote

Hi Anuj,
I've tried the below option and its working fine

Code:
*UNCOMMENT THE FOLLOWING LINE TO ENABLE DEBUGGING MODE
*SOURCE-COMPUTER. IBM-ZOS WITH DEBUGGING MODE.
------
i've asked you about the error i got while executing the REXX Macro (DELETES THE DISPLAY LINES ADDED BY ADDISP MACRO)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 05, 2009 8:39 pm
Reply with quote

Hello,

Quote:
i've asked you about the error i got while executing the REXX Macro (DELETES THE DISPLAY LINES ADDED BY ADDISP MACRO)
Suggest both you (and the rest of the forum) will be better served if you ask technical questions in the proper part of the forum rather than via PM.

Some considerations are that if a question is sent via PM, there may be an extended amount of time before the question is even seen. Another is that if some question/answer dialog goes on between only 2 people, others cannot offer help or use the information presented in the PMs.

PM should be used for "Private Messages" - not technical discussion. If someone has a question, it is almost certain that someone else has the same question and will benefit from the discussion.

d
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: USA

PostPosted: Wed May 06, 2009 10:30 am
Reply with quote

Hi Dick,

I have asked my query in this same loop itself, i have sent the same to Anuj in PM.. Sorry for the Inconvenience.

Quote:
Hi Anuj,

While executing the second Macro (DELETES THE DISPLAY LINES ADDED BY ADDISP MACRO) em gettingan Error.

16 +++ CURLINE = CURLINE + 1
IRX0041I Error running DEDISP, line 16: Bad arithmetic conversion


Can you get me, where em going wrong.
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: USA

PostPosted: Wed May 06, 2009 11:21 am
Reply with quote

Hi All,

I have found the Error, I have just initialized the Variable as like below,

Code:
CURLINE = 0                                 
ADDRESS ISREDIT "(CURLINE,CURCOLM) = CURSOR"
CURLINE = CURLINE + 1


Now the REXX code is working fine..

Thanks Anuj..
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Jul 06, 2009 11:37 am
Reply with quote

You're welcome and thanks for letting us know that it worked the way you needed. icon_smile.gif

PS. They say it's never late to acknowledge. icon_wink.gif
Back to top
View user's profile Send private message
manojkumar.sesuraj

New User


Joined: 15 Apr 2009
Posts: 43
Location: Mumbai

PostPosted: Tue Jul 07, 2009 10:56 am
Reply with quote

I am new to REXX. Can anybody tell me how to run this REXX code? icon_idea.gif

Even, I have also faced this problem.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Jul 07, 2009 11:30 am
Reply with quote

Hi,

Quote:
I am new to REXX. Can anybody tell me how to run this REXX code?


If you are new to REXX I would suggest you to read the forum manuals and then search the REXX forum as to how to run a simple REXX code.

One such post of mine for executing a REXX code.



RUN A REXX
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Jul 07, 2009 11:53 am
Reply with quote

Did you follow the posts from Dick and Terry? What happend?

And in this
Quote:
I have also faced this problem
"this" need an explanation ... icon_smile.gif
Back to top
View user's profile Send private message
manojkumar.sesuraj

New User


Joined: 15 Apr 2009
Posts: 43
Location: Mumbai

PostPosted: Tue Jul 07, 2009 12:55 pm
Reply with quote

Thanks Aaru & Anuj for your response.

Last week, I added the displays in all paragraphs and sections in my cobol program. In my shop, we have a CLIST code which will add displays in all para and sections.

I know, how to run Rexx code only basic level (Only Basic level - like EX command in front of the member name or TSO EXEC "PDS(MEMBER)").

I just asked, how to run the above code? (which means, where do I need to include my cobol program?)
Back to top
View user's profile Send private message
karz

New User


Joined: 04 Feb 2010
Posts: 39
Location: Mumbai

PostPosted: Thu Jun 10, 2010 12:28 pm
Reply with quote

I tried the above way of Source computer with debugging option. But it is not working for me. Can anyoen tell what else do we need to do. What is the 7D column funda
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 10, 2010 4:33 pm
Reply with quote

There is a link to manuals at the top of the page. If you click it, find the COBOL Language Reference, and search you can find
Quote:
APPENDIX1.4.1 Debugging lines

A debugging line is a statement that is compiled only when the compile-time switch is activated. Debugging lines allow you, for example, to check the value of a data item at certain points in a procedure.

To specify a debugging line in your program, code a D in column 7 (the indicator area). You can include successive debugging lines, but each must have a D in column 7. You cannot break character-strings across two lines.

All your debugging lines must be written so that the program is syntactically correct, whether the debugging lines are compiled or treated as comments.

You can code debugging lines anywhere in your program after the OBJECT-COMPUTER paragraph.

A debugging line that contains only spaces in Area A and in Area B is treated as a blank line.
Back to top
View user's profile Send private message
karz

New User


Joined: 04 Feb 2010
Posts: 39
Location: Mumbai

PostPosted: Thu Jun 10, 2010 5:12 pm
Reply with quote

i tried the rexx...it is not giving any error but it is not adding any displays to my source..can anyone help me with that
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 10, 2010 5:56 pm
Reply with quote

Well, how did you "try" it?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 10, 2010 5:58 pm
Reply with quote

Anuj,

welcome to 99% of the problem of supplying code to rookies - support!
Back to top
View user's profile Send private message
karz

New User


Joined: 04 Feb 2010
Posts: 39
Location: Mumbai

PostPosted: Thu Jun 10, 2010 5:59 pm
Reply with quote

i executed the rexx by TSO TRACEON(i saved the rexx with this name in my SYSproc... it did not give any error ...but it did not insert any displays also
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 10, 2010 6:01 pm
Reply with quote

Quote:
TRACEON


rename the REXX script.
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 -> COBOL Programming Goto page 1, 2, 3  Next

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts SCOPE PENDING option -check data DB2 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top