View previous topic :: View next topic |
Author |
Message |
jacky_ying Beginner
Joined: 25 Jul 2004 Posts: 46 Topics: 20
|
Posted: Wed Jan 26, 2005 12:53 pm Post subject: get line number of source code in cobol |
|
|
Hi,all
Is there a simply way to get line number of source code in cobol.
I want to display the line number for trace&debug purpose,
like this
IF ......
THEN
DISPLAY 'programe error in line' LINE-NUMBER
END-IF
In C language,there is a pre-compile macro " __LINE__ " can done this,
Is there similar facility in COBOL just like this.
I search this forums and some manuals but didn't found what i want
thanks in advance very much!  |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Sun Jan 30, 2005 1:13 pm Post subject: |
|
|
Hi Jacky,
I've seen the following technique when a common "abend" routine was used:
The pgraph detecting the error typically passes the "abend" routine the following info:
Error type, RC, pgraph name, seq# within pgraph. You can add or sub. The "abend" routine displays the info and usually "user abends".
The debugger uses the "pgraph name, seq# within pgraph" to isolate the offending COBOL stmt.
Hope this helps. _________________ Regards, Jack.
"A problem well stated is a problem half solved" -- Charles F. Kettering |
|
Back to top |
|
 |
jacky_ying Beginner
Joined: 25 Jul 2004 Posts: 46 Topics: 20
|
Posted: Tue Feb 01, 2005 8:10 am Post subject: |
|
|
Hi kolusu,slade
thanks for all of your hints! |
|
Back to top |
|
 |
|
|