Skip to main content

Reconcile the Address in a Runtime Error

  • January 25, 2013
  • 2 replies
  • 0 views

Hello,

I was wondering if there was a way to find the line of code in a program that generated a runtime error. For example, the following error

Exception Raised, ERR-CODE = H'800a017d'
COBOL error at 018DF0 in ../ar/HMEINVPST.ACU
Called from 00DBE7 in POSMENU.ACU

Is is possible to open the source code for HMEINVPST.ACU, and find 018DF0, and if so how do I go about it?

Thanks

2 replies

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • January 25, 2013

Hello,

I was wondering if there was a way to find the line of code in a program that generated a runtime error. For example, the following error

Exception Raised, ERR-CODE = H'800a017d'
COBOL error at 018DF0 in ../ar/HMEINVPST.ACU
Called from 00DBE7 in POSMENU.ACU

Is is possible to open the source code for HMEINVPST.ACU, and find 018DF0, and if so how do I go about it?

Thanks

When you compile HMEINVPST do you create a listing? i.e ccbl32 -lfo @.lst HMEINVPST.cbl .. the 018DF0 should correspond to a line in the listing.


  • Author
  • Rocketeer
  • 19312 replies
  • January 27, 2013

Hello,

I was wondering if there was a way to find the line of code in a program that generated a runtime error. For example, the following error

Exception Raised, ERR-CODE = H'800a017d'
COBOL error at 018DF0 in ../ar/HMEINVPST.ACU
Called from 00DBE7 in POSMENU.ACU

Is is possible to open the source code for HMEINVPST.ACU, and find 018DF0, and if so how do I go about it?

Thanks

You can add the compile option -Gl to include line numbers.  The above error message would then look something like:

Exception Raised, ERR-CODE = H'800a017d'
COBOL error at 018DF0 in ../ar/HMEINVPST.ACU
("HMEINVPST.cbl", line 3456)
Called from 00DBE7 in POSMENU.ACU

If the offending code is in a copybook, then the filename and line number of the copybook will be shown.

You can also use the -Ga option, which enables all of the debugging options (-Gd -Gl -Gs -Gy).  However, I would strongly suggest just using -Gd and -Gl for testing and debugging.  For production/deployment, where you don't want your source code included in the object files, you can just use -Gl and still get the line numbers reported on fatal errors.

Note that the above -G* compile options were added some time ago to replace the older -Zd and -Zs options.