View previous topic :: View next topic
|
Author |
Message |
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Hi,
I am getting the follo error while compiling a non-db2 cobol program.
Code: |
582 IGYPA3043-E Data-item "MERGED-FILE-RECORD (GROUP)" and record "MERGED-FILE-RECORD (GROUP)" had overlapping storage.
Movement of data may not occur at execution time. |
My definitions in the program:
Code: |
FILE-CONTROL.
SELECT MERGE-INP-FILE ASSIGN TO FWB750I1
ORGANIZATION IS INDEXED
ACCESS IS SEQUENTIAL
RECORD KEY IS MERGE-KEY
FILE STATUS IS CURRENT-STATUS. |
------
------
Code: |
DATA DIVISION.
FILE SECTION.
FD MERGE-INP-FILE
LABEL RECORDS ARE STANDARD.
01 MERGED-FILE-RECORD.
05 MERGE-KEY.
10 MERGED-FILE-KEY-MOST. |
----
----
----
Code: |
PROCEDURE DIVISION.
READ MERGE-INP-FILE
AT END
MOVE 'Y' TO EOF-ON-MERGE. |
I am getting the error while reading.
My compiler version is
Code: |
IBM Enterprise COBOL for z/OS 3.4.1 |
Any pointers will be of great help.
Thanks,
Viji |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You will probably need to post more of your code for us to help.
Quote: |
I am getting the error while reading |
Are you saying that the compile raises an error on the READ statement?
Your problem is most likely in the definitions within the MERGE-INP-FILE. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Please provide where Data-item "MERGED-FILE-RECORD (GROUP)" and record "MERGED-FILE-RECORD (GROUP)" are defined? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
CICS Guy wrote: |
Please provide where Data-item "MERGED-FILE-RECORD (GROUP)" and record "MERGED-FILE-RECORD (GROUP)" are defined? |
He actually did in his first post. More than likely there is a MOVE MERGED-FILE-RECORD TO MERGED-FILE-RECORD, a READ INTO, or a WRITE FROM statement somewhere in the program. Have you looked at line 582 in the compile listing? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Was kinda hoping that it would be posted. . . .
We'll see. . . |
|
Back to top |
|
|
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Hi All,
thanks for all the replies..I got the problem solved.
I moved the entire 01 MERGED-FILE-RECORD to a Working-storage section and replaced the FD as shown below
Code: |
FILE SECTION.
FD MERGE-INP-FILE
LABEL RECORDS ARE STANDARD.
01 FD-MRGE-RECORD.
05 FD-MERGE-KEY PIC X(18).
05 FILLER PIC X(133). |
Later I moved FD-MRGE-RECORD to MERGED-FILE-RECORD
Previously I had the following set of variables under FD section.
Code: |
01 MERGED-FILE-RECORD.
05 MERGE-KEY.
10 MERGED-FILE-KEY-MOST.
15 MERGED-ACCT.
20 MERGED-OFFICE-NBR PICTURE X(03).
20 MERGED-ACCT-NBR PICTURE X(05).
15 MERGED-SEC-NBR PICTURE X(05).
15 MERGED-TRANS-DATE PICTURE X(03).
10 MERGED-SEQ-NBR PICTURE S9(04) COMP.
05 MERGED-FILE-FILL.
07 FILLER PICTURE X(97).
07 MERGED-FILE-EXP-PX-IND PICTURE X(01).
07 MERGED-FILE-EXP-PX.
09 FILLER PICTURE X(07).
09 MERGED-FILE-EXP-PX-8 PICTURE S9 COMP-3.
07 MERGED-FILE-REORG PICTURE X(001).
07 FILLER PICTURE X(026). |
I still did not know why it didn't work, but I had to move on bse of my schedule. I would be glad if someone can identify.
Thanks,
Viji |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Later I moved FD-MRGE-RECORD to MERGED-FILE-RECORD |
This was most likely your problem. Both of these were level 01 entries in the same FD. You were moving the data to "itself".
When you moved the definition to WS, you corrected the error.
Why did you try to move from one dataname to the other when they were both representations of the exact same data? |
|
Back to top |
|
|
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Hi,
I am sorry if I didn't explain it clearly.
My initial code :
1) MERGED-FILE-RECORD as 01 in FD. and I read the file.
no other moves.
Modified code:
1) Moved MERGED-FILE-RECORD to Working storage.
2) Added FD-MRGE-RECORD in FD section and read the file
3) Move FD-MRGE-RECORD to MERGED-FILE-RECORD for further use in the program.
I am not sure what I did wrong and what I did right in the modified code!!
Thanks,
Viji |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
vijikesavan wrote: |
I am not sure what I did wrong and what I did right in the modified code!! |
Duplicate names are ok with COBOL, but to reference one of them you need a higher level of name in order to say duplicate-name OF unique-higher-level-name.....
Since 01 levels are the highest level of naming, two 01s with the same name are not allowed in one program....
Do you need a link th the COBOL manual on that section? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Viji,
Well, the good news is that it is working
Quote: |
I am not sure what I did wrong and what I did right in the modified code!! |
When the error was raised, the compiler was "confused/concerned" by something and your change(s) removed the confusion/concern. |
|
Back to top |
|
|
|