Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to resolve the data overlapping due to occur clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to resolve the data overlapping due to occur clause
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    Post subject:
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: 788
Location: Chennai, India

PostPosted: Wed Mar 12, 2008 7:26 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: How to resolve the data overlapping due to occur c
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    Post subject:
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    Post subject: Reply to: How to resolve the data overlapping due to occur c
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    Post subject:
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

Senior Member


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

PostPosted: Thu Mar 13, 2008 12:54 am    Post subject:
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    Post subject: Reply to: How to resolve the data overlapping due to occur c
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

Senior Member


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

PostPosted: Sun Mar 16, 2008 2:23 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: How to resolve the data overlapping due to occur c
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us