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

How to resolve the data overlapping due to occur clause


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

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Wed Mar 12, 2008 7:16 pm
Reply with quote

an you please help on this...

I have three arrays declared in my cobol as follows

01 ARRAY-1.
02 WS-PRO-ARRAY OCCURS 3000 TIMES.
05 WS-PRO-ARR PIC X(351).

01 ARRAY-2.
02 WS-ADD-ARRAY OCCURS 3000 TIMES.
05 WS-ADD-ARR PIC X(194).

01 ARRAY-3.
02 WS-CON-ARRAY OCCURS 3000 TIMES.
05 WS-CON-ARR PIC X(206).

In the program,

Array-1 will be moved with 900 records from input file1
Array-2 will be moved with 800 records from input file2
Array-3 will be moved with 2100 (which is > 2000 declared limit in cobol) records from input file3

Finally when read the Array-2, it has the records overlapped

In thought of array-3 has caused the issue, I have increase the
limit from 2000 to 2200 and tried . But i got the same issue.

I tried increasing the limit of other array too. But the problem is not resolved
.Still the array-1 has the records got overlapped.

Please give an helping hand to resolve this issue.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Mar 12, 2008 7:26 pm
Reply with quote

Check after you load each array to see when the error occurs.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Mar 12, 2008 7:26 pm
Reply with quote

INITIALIZE those tables(arrays) to SPACES if you are using them for more than once before moving data to them.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 12, 2008 8:26 pm
Reply with quote

Declare a counter for each of the internal COBOL Tables.

As you load each table, check the counter against the max number of occurances allowed for each table.
Back to top
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Wed Mar 12, 2008 9:01 pm
Reply with quote

Thank you..

I have just tried initializing the arrays which was not done before.
but still the array-2 has the same issue.

Further, the array overlapped happens only when the array-3 file get loaded with more than 2002 record exactly. say 2003 records.
And it is working fine when we give 2002 number of records as input to array-3.

Still i am working on it to resolve this....
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Mar 12, 2008 10:09 pm
Reply with quote

How is the subscript you are using defined?
Back to top
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Wed Mar 12, 2008 11:50 pm
Reply with quote

Hi Craq Giegerich,

My subscripts are defined as follows,

01 WS-PRO-CNT PIC 9(04) VALUE 0. for array-1
01 WS-ADD-CNT PIC 9(04) VALUE 0. for array-2
01 WS-CON-CNT PIC 9(04) VALUE 0. for array-3
Back to top
View user's profile Send private message
Pcrummey

New User


Joined: 26 Feb 2008
Posts: 4
Location: Van Wert, OH

PostPosted: Thu Mar 13, 2008 12:36 am
Reply with quote

Isn't there a max number of bytes for working storage?

Something like: Fixed length group items or tables are limited to 131,071 bytes.

There may not be any limitation any more(Never worked with working storage that big), I know there is for linkage to another program. But if there is a limit, your first Occurs would be over 1 million bytes. There is occurs depending that would make your table variable on the number of input records.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 13, 2008 12:54 am
Reply with quote

Hi,

I might sound little dumb but didn't get when you say 'overlap'..what data do You expect in WS-PRO-ARRAY(1) & what do you get because of 'overlap'?
Back to top
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Thu Mar 13, 2008 10:41 am
Reply with quote

Hi,

I meant data overlap because when read WS-PRO-ARRAY(i) and it has data that loaded from file-1 but it is not mapped at all with corresponding layout. All the records look like misplaced and get mixed with other records. I am not sure whether Array-3 is overlapped with Array-1. It looks like dump...

Thanks many...
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sun Mar 16, 2008 2:23 pm
Reply with quote

Hi,

Show the data fromt input file & the data (perhaps DISPLAYs) using which you could say..
Quote:
It looks like dump...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Mar 17, 2008 12:39 pm
Reply with quote

sounds as if you descision process (which array to populate) fails to properly identify which internal cobol table to fill, or one fo your routines to populate the internal cobol tables is populating the wrong table.
Back to top
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Sun Mar 23, 2008 2:03 pm
Reply with quote

Hi,

Thanks everyone for your time...

Due to time constraint, the same code has been replaced with SAS... But I suspect the problem was with array initialization... I will let everyone know if it the problem is identified in my testing...

thanks....
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 Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top