MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

get line number of source code in cobol

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
jacky_ying
Beginner


Joined: 25 Jul 2004
Posts: 46
Topics: 20

PostPosted: Wed Jan 26, 2005 12:53 pm    Post subject: get line number of source code in cobol Reply with quote

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! Question
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jan 26, 2005 1:24 pm    Post subject: Reply with quote

jacky_ying,

Look up the TEST complier option. Check this link for a detailed explanation of the TEST compiler option

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/2.4.50?DT=20020923143836

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sun Jan 30, 2005 1:13 pm    Post subject: Reply with quote

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


Joined: 25 Jul 2004
Posts: 46
Topics: 20

PostPosted: Tue Feb 01, 2005 8:10 am    Post subject: Reply with quote

Hi kolusu,slade
thanks for all of your hints!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group