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

Internal Table Over Flow


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

New User


Joined: 27 Jul 2006
Posts: 9

PostPosted: Tue Aug 01, 2006 11:08 am
Reply with quote

Suppose i have a table X occurs 5 Times, But I increment the counter and Write 8 times. Where will the Extra 3 records will go.
Back to top
View user's profile Send private message
Muthukumar.PLindia

New User


Joined: 03 Jul 2006
Posts: 51
Location: Chennai

PostPosted: Tue Aug 01, 2006 11:16 am
Reply with quote

SOC4 abend will occur... while trying to write the 5 th record
Back to top
View user's profile Send private message
SBMF390

New User


Joined: 27 Jul 2006
Posts: 9

PostPosted: Tue Aug 01, 2006 11:25 am
Reply with quote

No, My Question is Where will the Extra 3 records will be written.
Back to top
View user's profile Send private message
giri_82

New User


Joined: 19 Jul 2006
Posts: 6

PostPosted: Tue Aug 01, 2006 3:04 pm
Reply with quote

The Next three records wont be written.. It will give soc4 on referring to the 6th occurance. ie it will abend while trying to write the 6th record
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Aug 01, 2006 8:17 pm
Reply with quote

Can I ask a clarification of your question? Are you asking if you have a table TBL-X occurs 5 times, and you populate the table to TBL-X(8) what happened to table occurrences 6, 7, and 8?

Dave
Back to top
View user's profile Send private message
SBMF390

New User


Joined: 27 Jul 2006
Posts: 9

PostPosted: Wed Aug 02, 2006 10:10 am
Reply with quote

Yes Dave you are right
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Wed Aug 02, 2006 2:42 pm
Reply with quote

Would the data not be written to the next available slot in memory as if the table was defined as occurs 8?

thus any fields actually defined after the 5th occurance would overwrite the working storage which can lead to trouble eg S0C7s etc
sometimes depending on where the table is situated and by how much you overwrite it you can also corrupt the program code itself.
Back to top
View user's profile Send private message
SBMF390

New User


Joined: 27 Jul 2006
Posts: 9

PostPosted: Wed Aug 02, 2006 5:33 pm
Reply with quote

That's grt. Thanks all.
Back to top
View user's profile Send private message
ursprasanna
Warnings : 2

New User


Joined: 15 May 2006
Posts: 20
Location: chennai

PostPosted: Thu Aug 03, 2006 11:57 pm
Reply with quote

hi Iqofagerbil,

you have mentioned that there will be a SOC7 error . but i think it must be a SOC4 error .

the s0c7 error occurs only where there is a alphanumeric field in a numeric variable or vice versa.

Please correct me if i am wrong.

can u please explain if how there could be a soc7 error in that case if am wrong.

Thanks,
prasanna subramaniam.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Aug 04, 2006 12:29 am
Reply with quote

prasanna,

0C7s are pretty common on table overflow conditions. As correctly stated above, when you overflow the table, it overlays any working storage following the table definition. The 0C7 occurs when you overlay a COMP-3 field with non-packed data, and then try to access the field. The table overflow ABEND generally does not occur on the overflow of the table, but rather when you try to access the corrupted data following the table.

Dave
Back to top
View user's profile Send private message
neeraj.cics
Currently Banned

New User


Joined: 05 Jun 2006
Posts: 1
Location: bangalore

PostPosted: Fri Aug 04, 2006 2:04 am
Reply with quote

i think all you r saying it may be right.but i think records 6,7,8 may come in the ouput unless u have not given SSRANGE IN the syntax.....we have to define SSRANGE or you can retrieve data above the defined range.....
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Aug 04, 2006 4:28 am
Reply with quote

Neeraj,

I agree with you partly. You can store data in a table outside the limits of the table, and then retrieve it later in the processing, assuming that the program does not abend, and the program has not stored data in the variables that were corrupted by the overlay, now corrupting the table entry or having the program use a corrupted variable from the overlay. This condition, where the program does not abend and the table has been overflowed, can be very difficult to analyze.

Good programming code will prevent this from happening. The problem with using SSRANGE is the CPU resources it takes to execute. And then your program still Abends when a fault is encountered. I guess this prevents the problem of the program continuing to run.


Dave
Back to top
View user's profile Send private message
ursprasanna
Warnings : 2

New User


Joined: 15 May 2006
Posts: 20
Location: chennai

PostPosted: Fri Aug 04, 2006 1:11 pm
Reply with quote

Dave,

I am completely confused on this . can you make it more clear.

As of as i know when you try to store more than the specified range and the program is compiled with out the ss-range option the 6,7,8 values will be over writen on the 5 position and if the program is compiled with out ss-range option it will go with a soc4 abend saying memeory violation.

I am not clear of what you have mentioned about the bata overflow in the working storage .....

thanks in advanvce for your efforts,

Prasanna subramaniam.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Aug 05, 2006 8:21 am
Reply with quote

Hi guys,

The ques that wasn't asked, like Sherlock Holmes' dog that didn't bark is the key that solves the mystery.

Does the table use an index or a subscript? If an index, then an 0C4 results.

If a subscript, you have your choice of disasters. An 0C7 is the most common if the moved data stays within the WS. If the data move goes outside the bounds of the pgm an 0C4 results. If the data is moved into the procedure division code anything can happen. If you're REALLY unlucky you may not get any abend at all, but your pgm will probably produce erroneous data. BAD!!!

Did I just make a case for using indexes for tables? icon_confused.gif
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Mon Aug 07, 2006 10:00 am
Reply with quote

Hi guys,

I can explain this with my personel experience.

I had a cobol program which can handle 10 rows (internal table). Once there was an issue with the input, we got 13 records.

The following error msg is displayed in Sysprint and the job got abended.

RECORD TYPE=F,LENGTH=(000111,,)
CEE3207S The system detected a data exception (System Completion Code=0C7).


you can clearly see there is data access violation. Which will usually result when trying to access the memory area outside the scope.

the records will not be processed for the rest.

Hope i could make things clear.

regards,
Diwakar.D
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Aug 10, 2006 3:26 am
Reply with quote

Hi Diwakar.D,

You didn't get an 0C7 abend because you "accessed" data outside the "scope", you got it because the system executed an arithmetic instruction against data that wasn't formatted properly for that type of arithmetic instruction.

There's a world od difference between the two.
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 Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top