View previous topic :: View next topic
|
Author |
Message |
rswathi_1208
New User
Joined: 14 May 2010 Posts: 11 Location: chennai
|
|
|
|
Hi,
I have two files. one is of length 51 and another of length 10. I am comparing these two files and I need to write the matching records in one file and un matching records in another file. Please find my code below. while executin I am getting error messasage as invalid file reference FileA
Code: |
FILE FILEA
PARTA 1 10 A
I-RECA 1 51 A
FILE FILEB
PARTB 1 10 A
FILE FILE01
O-REC1 1 51 A
FILE FILE02
O-REC2 1 51 A
*
RCOUNT-OUT1 W 8 N
RCOUNT-OUT2 W 8 N
*
JOB INPUT (FILEA KEY PARTA FILEB KEY PARTB) FINISH FINISH-PROC
IF MATCHED FILEA FILEB
MOVE ' ' TO O-REC1
MOVE I-RECA TO O-REC1
PUT FILE01
RCOUNT-OUT1 = RCOUNT-OUT1 + 1
ELSE
IF FILEB
MOVE ' ' TO O-REC2
MOVE I-RECA TO O-REC2
PUT FILE02
RCOUNT-OUT2 = RCOUNT-OUT2 + 1
END-IF
END-IF
FINISH-PROC. PROC.
DISPLAY ' MATCH ' RCOUNT-OUT1
DISPLAY ' NOT MATCH ' RCOUNT-OUT2
END-PROC
* |
MY ERROR MESSAGE :
23 *******A010 INVALID FILE REFERENCE - FILEA |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Are both files in sequence?
Which line of code is line 23?
What happens when there is a file a record and no matching file b record? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you are determined to "multi-post" because you don't get what you want in a topic, you may find our doors become closed. . .
The previous question were an attempt to get you to think about your process. . .
The problem is quite likely because you are moving fileA data in the fileB routine. . . |
|
Back to top |
|
|
|