View previous topic :: View next topic
|
Author |
Message |
Abhushan_s
New User
Joined: 28 Jul 2008 Posts: 34 Location: Ahmedabad
|
|
|
|
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 , 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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
Abhushan_s
New User
Joined: 28 Jul 2008 Posts: 34 Location: Ahmedabad
|
|
|
|
Hey Thank you Anuj for the help,
but iam not having any prior knowledge of REXX . Anyways will try it out with someone knowing it. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
balukanna
New User
Joined: 09 Apr 2008 Posts: 41 Location: USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
balukanna
New User
Joined: 09 Apr 2008 Posts: 41 Location: USA
|
|
|
|
I've tried it and its working fine..
Thanks for your replies.. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 . . . |
|
Back to top |
|
|
balukanna
New User
Joined: 09 Apr 2008 Posts: 41 Location: USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
balukanna
New User
Joined: 09 Apr 2008 Posts: 41 Location: USA
|
|
|
|
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 |
|
|
balukanna
New User
Joined: 09 Apr 2008 Posts: 41 Location: USA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
You're welcome and thanks for letting us know that it worked the way you needed.
PS. They say it's never late to acknowledge. |
|
Back to top |
|
|
manojkumar.sesuraj
New User
Joined: 15 Apr 2009 Posts: 43 Location: Mumbai
|
|
|
|
I am new to REXX. Can anybody tell me how to run this REXX code?
Even, I have also faced this problem. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 ... |
|
Back to top |
|
|
manojkumar.sesuraj
New User
Joined: 15 Apr 2009 Posts: 43 Location: Mumbai
|
|
|
|
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 |
|
|
karz
New User
Joined: 04 Feb 2010 Posts: 39 Location: Mumbai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
karz
New User
Joined: 04 Feb 2010 Posts: 39 Location: Mumbai
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Well, how did you "try" it? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Anuj,
welcome to 99% of the problem of supplying code to rookies - support! |
|
Back to top |
|
|
karz
New User
Joined: 04 Feb 2010 Posts: 39 Location: Mumbai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
rename the REXX script. |
|
Back to top |
|
|
|