Operating System - HP-UX
1824994 Members
2120 Online
109678 Solutions
New Discussion юеВ

Runtime error in MicroFocus COBOL

 
SOLVED
Go to solution
Arturo Perez del Galleg
Frequent Advisor

Runtime error in MicroFocus COBOL

I have a runtime error in MicroFocus COBOL:

Object Code error : file '/visa3/step/tpb/TPB085.gnt'
error code: 153, pc=C2B5645B, call=1, seg=0
153 Subscript out of range

In the documentation of manual i seek:

4.6 Debugging Examples
...
4.6.2 UNIX Example
...
Execution error : file 'bug.int'
error code: 114, pc=29, call=2, seg=0
114 Attempt to access item beyond bounds of memory (Signal 11)
This error corresponds to the following segment of the report listing, which was generated by compiling bug.cbl with the LIST() and REF directives specified.

1 program-id. "bug". 0
2 working-storage section. 160
3 01 b pic x(20). 160
4 01 c pic x. 178
5 linkage section. 17C
6 01 a pic 9(6). 0
7 procedure division using a. 0
8 move "1" to b(a:1) 29
9 exit program. 30
...


but, in my report listing the scope of the address is different. Directives of compilation are:
cob -C 01SHUFFLE -C REF -P -u $fichero.cob
and my compilation report
...
1180 MOVE "FECHA :" TO TPL050-LITFEC-G02. C9A
1181 MOVE WS-SYS-DIA TO TPL050-FECHA-DD-G02. CA7
1182 MOVE WS-SYS-MES TO TPL050-FECHA-MM-G02. CAD
1183 MOVE WS-SYS-AAAA TO TPL050-FECHA-AA-G02. CB3
1184 MOVE "/" TO TPL050-FECHA-S1-G02 CB9
1185 TPL050-FECHA-S2-G02. CC1
1186 WRITE TPL050-R BEFORE 1. CC1
...
How can determine which is the line of the program involved in the error having pc=C2B5645B and the compilation report?
Thank you!

4 REPLIES 4
Jon McDermott
Advisor

Re: Runtime error in MicroFocus COBOL

If you compile with "-N hplineno" switch you should get some additional information on the "153" error line number that tells you the actual line number. This line number should correspond to lines in the .cob file.
A. Clay Stephenson
Acclaimed Contributor

Re: Runtime error in MicroFocus COBOL

Hi:

One other point, you should compile the COBOL source with -N "hpoptimize=0" as well so that the optimizer does not alter the code after the compiler.

If it ain't broke, I can fix that.
Kevin McKie
Occasional Advisor

Re: Runtime error in MicroFocus COBOL

Hello, Shiju -

I'm very interested in your response, as I'm having exactly the same problem myself. However, I can't locate either of the documents you mention (I'm using the European site, not the Americas/Asia-Pacific) and a search by Document I.D. fails to locate them either. Can you help?

Thanks in advance,

Kevin
Si monumentum requiris, ecce Washington.