Display statement fixes S0C4 Abend in COBOL.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Display statement fixes S0C4 Abend in COBOL.

Postby anurai » Wed Jul 01, 2015 10:42 am

Hi,

I was facing a S0C4 abend while executing a conversion program for a variable file. Out of 9000 records it wrote 318 records and abended at 319th record.
I inserted a Display statement in Logic check and, to my surprise the abend got resolved.

Any idea if it's a issue with Compiler being used or something else. How can adding a Display statement in program resolve S0C4 abend?
Has anyone else encountered such issue?
anurai
 
Posts: 1
Joined: Tue Jun 30, 2015 3:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Display statement fixes S0C4 Abend in COBOL.

Postby BillyBoyo » Wed Jul 01, 2015 12:24 pm

Why blame the compiler? 99.99999% of the time it is the code.

In your case it is the code.

The S0C4 is likely being caused by your program code being overwritten by your program. When you put in the DISPLAY, the location of what was being overwritten changed so something causing a lesser problem (or not even manifesting itself at this point).

You need to solve the S0C4 dump. It is likely a problem with subscripting or mangled parameters to a CALL.

What was your code change immediately before the S0C4? Are you using compiler option SSRANGE?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Display statement fixes S0C4 Abend in COBOL.

Postby Robert Sample » Wed Jul 01, 2015 5:57 pm

How can adding a Display statement in program resolve S0C4 abend?
This is wrong -- merely adding a DISPLAY statement did not RESOLVE the S0C4, it merely kept the S0C4 from happening. The root cause of the problem is still out there -- table being overlaid, problems with CALL arguments, or whatever -- and the problem will return if you take out the DISPLAY statement. I have seen similar problems in the past (I had a CICS program once that had an ABEND until Xpediter was used on the program, at which time the ABEND stopped happening), and you need to find / fix the root cause of the storage problem.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post