IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

S0C7 - Field getting overlayed


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ezra Walters

New User


Joined: 29 Jan 2023
Posts: 1
Location: Jacksonville

PostPosted: Sun Jan 29, 2023 9:57 pm
Reply with quote

Hi All,

Received a S0C7 after issuing a call to I/O subprogram. Subprogram reads DB2 tables, but when it returned to the calling program, the WS fields used as accumulators are getting S0C7 when ADD statement is issued by calling program. I know it is overlaying the storage area where the fields are defined.

Any idea on resolution.
1)WS field is COMP-3, with Value clause zeros.
2) My first APS program, it was cloned, I think it is static call
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2051
Location: USA

PostPosted: Mon Jan 30, 2023 2:53 am
Reply with quote

Zero useful information presented.

Not enough data to give any response except: “There is a bug somewhere in your code”

Try to trace step-by-step every operation, - between reading DB2 tables, and the failed attempt to use COMP-3 field(s).
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3059
Location: NYC,USA

PostPosted: Mon Jan 30, 2023 10:05 am
Reply with quote

Welcome !
1. Review the called module how does it populate ws variables that you are receiving. If it’s working submodules for years then it’s an issue in callling module.
2. Review calling module to make sure you initialize all IO variables and then populate values as needed for called program before issuing a call statement.
3 once you get control back from the called module do primary validation of received data like IS NUMERIC or using db2 functions and trap any errors here .
4. Btw, You can easily tell it’s it’s static or dynamic call , if you have used program name in single quotes during the call then it’s static and if you have used variable name then it’s dynamic.

If everything is good then go forward with compute or ADD .

Good Luck 👍
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
This topic is locked: you cannot edit posts or make replies. Construct new record using specific f... DFSORT/ICETOOL 6
Search our Forums:

Back to Top