问题
Is there any way that we can find the exact line number that causes an abend ( like SO4C) from the Offset(like offset +00007D0A at address 1515CD0A
) given in the spool with the error message.?
回答1:
If your program is compiled with options OFFSET,NOLIST, you will have a list of verbs/line numbers in the output listing which contain the "offset" from the start of the program. The line number on the the listing which has the closest offset, but less than or equal to, the "offset" reported in the abend, is where you want to look.
If you use NOOFFSET,LIST, you will get the "generated assembler" in your compile listing, and your abend "offset" should match exactly to the "offset" of one of the generated instructions, and you should be able to easily identify the COBOL source line from that, it is the first verb with line number before the actual machine instruction listed.
Bear in mind that in the rare cases in which you've managed to overwrite program code and that has eventually caused an abend you'll have to work harder, but for an "ordinary" abend it is quite straightforward.
If you use compiler options NOLIST,NOOFFSET, then you will have no clue. Re-run the compile with one of the options set. Unless the program sizes are identical, run the abending job again as well
If you use LIST,OFFSET, the compiler will produce a diagnostic message, and you will have to choose one of the valid options. LIST and OFFSET are mutually exclusive.
来源:https://stackoverflow.com/questions/17102134/abend-causing-line