Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Option for tracking code during compiling
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Option for tracking code during compiling
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

Senior Member


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

PostPosted: Mon Mar 02, 2009 12:24 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Mon Mar 02, 2009 1:39 pm    Post subject:
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: chennai

PostPosted: Mon May 04, 2009 2:55 pm    Post subject: Reply to: Compile a COBOL program.
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    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Mon May 04, 2009 9:19 pm    Post subject:
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: chennai

PostPosted: Tue May 05, 2009 10:13 am    Post subject: Reply to: Compile a COBOL program.
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

Senior Member


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

PostPosted: Tue May 05, 2009 5:37 pm    Post subject: Re: Reply to: Compile a COBOL program.
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: chennai

PostPosted: Tue May 05, 2009 6:26 pm    Post subject: Reply to: Compile a COBOL program.
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

Site Director


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

PostPosted: Tue May 05, 2009 8:39 pm    Post subject: Reply to: Compile a COBOL program.
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: chennai

PostPosted: Wed May 06, 2009 10:30 am    Post subject: Reply to: Compile a COBOL program.
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: chennai

PostPosted: Wed May 06, 2009 11:21 am    Post subject: Reply to: Compile a COBOL program.
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

Senior Member


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

PostPosted: Mon Jul 06, 2009 11:37 am    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Jul 07, 2009 11:30 am    Post subject: Reply to: Compile a COBOL program.
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

Senior Member


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

PostPosted: Tue Jul 07, 2009 11:53 am    Post subject:
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    Post subject:
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    Post subject: Reply to: Compile a COBOL program.
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: 7913
Location: Bellevue, IA

PostPosted: Thu Jun 10, 2010 4:33 pm    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us