View previous topic :: View next topic |
Author |
Message |
satheeshs Beginner
Joined: 06 Jul 2006 Posts: 13 Topics: 3 Location: 'Mainframe World'
|
Posted: Tue Jul 11, 2006 9:11 am Post subject: Easytrieve - invalid file reference error |
|
|
hi all,
i got this 'A010 -INVALID FILE REFERENCE - filename' error
the input file has records
FILEA
0000000001
0000000005
0000000009
0000000013
0000000024
0000000026
0000000029
.
.
.
.
.
.
FILEB
0000000001
0000000005
0000000024
0000000026
0000000034
0000000040
0000000042
.
.
.
.
.
.
.
KEY i have used is
JOB INPUT ( FILEA KEY (KEY1) FILEA KEY (KEY1) )
both KEY1 and KEY2 has length 10 characters.
while i have compared these two files
i got this
FILEA 4 INPUT
FILEB 3 INPUT
and
A010 -INVALID FILE REFERENCE - FILEB
It is not End of file in both the files, but still i got this error.
i am suspicious about the 5th record in FILEA and 3rd record in FILEB.
i am very new to easytrieve. Please help me out.
Cheers _________________ Satheesh |
|
Back to top |
|
|
satheeshs Beginner
Joined: 06 Jul 2006 Posts: 13 Topics: 3 Location: 'Mainframe World'
|
Posted: Tue Jul 11, 2006 9:14 am Post subject: |
|
|
Quote: |
got this
FILEA 4 INPUT
FILEB 3 INPUT
and
A010 -INVALID FILE REFERENCE - FILEB
|
The output i got is exactly
FILEA 4 INPUT SAM FIX BLK 10 27990
FILEB 3 INPUT SAM FIX BLK 10 27990
and the error
*******A010 INVALID FILE REFERENCE - FILEB _________________ Satheesh |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Jul 11, 2006 9:26 am Post subject: |
|
|
satheeshs,
Your JOB statement refers FILEA twice instead of FILEB . You are getting Invalid file reference error because you might be referrring to file in a not found condition. Ideally your easytrieve match logic should be as follows
Code: |
FILE FILEA
FILEA-KEY 01 010 A
FILE FILEB
FILEB-KEY 01 010 A
FILE MATCH FB(0 0)
FILE ONLYFILA FB(0 0)
FILE ONLYFILB FB(0 0)
JOB INPUT (FILEA KEY (FILEA-KEY) +
FILEB KEY (FILEB-KEY))
IF MATCHED
PUT MATCH FROM FILEA
ELSE-IF FILEA
PUT ONLYFILA FROM FILA
ELSE-IF FILEB
PUT ONLYFILB FROM FILEB
END-IF
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
satheeshs Beginner
Joined: 06 Jul 2006 Posts: 13 Topics: 3 Location: 'Mainframe World'
|
Posted: Tue Jul 11, 2006 9:29 am Post subject: |
|
|
Quote: |
Your JOB statement refers FILEA twice instead of FILEB . You are getting Invalid file reference error because you might be referrring to file in a not found condition
|
i am sorry it is typo error.
my code is exactly
Code: |
FILE FILEA
FILEA-REC 1 21 A
FILEA-X-CUST-NO 1 10 A
FILEA-Y-CUST-NO 11 11 A
FILE FILEB
FILEB-X-CUST-NO 1 10 A
FILE MISS02CS
MISS02CS-REC 1 21 A
MISS02CS-X-CUST-NO 1 10 A
MISS02CS-Y-CUST-NO 11 11 A
FILE MISSCS02
MISSCS02-REC 1 21 A
MISSCS02-X-CUST-NO 1 10 A
MISSCS02-Y-CUST-NO 11 11 A
WS-COUNT-02CS W 8 N VALUE 0
WS-COUNT-CS02 W 8 N VALUE 0
JOB INPUT ( FILEA KEY (FILEA-X-CUST-NO) +
FILEB KEY (FILEB-X-CUST-NO) ) +
FINISH FIN-PROC
IF NOT MATCHED
IF FILEB
MOVE FILEB-X-CUST-NO TO MISS02CS-X-CUST-NO
MOVE FILEA-Y-CUST-NO TO MISS02CS-Y-CUST-NO
PUT MISS02CS
WS-COUNT-02CS = WS-COUNT-02CS + 1
END-IF
IF FILEA
MOVE FILEB-X-CUST-NO TO MISSCS02-X-CUST-NO
MOVE FILEA-Y-CUST-NO TO MISSCS02-Y-CUST-NO
PUT MISSCS02
WS-COUNT-CS02 = WS-COUNT-CS02 + 1
END-IF
END-IF
FIN-PROC. PROC
DISPLAY WS-COUNT-02CS
DISPLAY WS-COUNT-CS02
END-PROC
|
_________________ Satheesh |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Jul 11, 2006 10:04 am Post subject: |
|
|
Quote: |
IF FILEA
MOVE FILEB-X-CUST-NO TO MISSCS02-X-CUST-NO
MOVE FILEA-Y-CUST-NO TO MISSCS02-Y-CUST-NO
PUT MISSCS02
WS-COUNT-CS02 = WS-COUNT-CS02 + 1
END-IF
|
b]satheeshs[/b],
Never code a Negtive logic especially with easytrieve file matching logic. You are referring to fileB cust-no when looking for FILEA. keep it simple so that it is easier to maintain and understand.
Code: |
JOB INPUT ( FILEA KEY (FILEA-X-CUST-NO) +
FILEB KEY (FILEB-X-CUST-NO) ) +
FINISH FIN-PROC
IF MATCHED
MOVE FILEB-X-CUST-NO TO MISS02CS-X-CUST-NO
MOVE FILEA-Y-CUST-NO TO MISS02CS-Y-CUST-NO
PUT MISS02CS
WS-COUNT-02CS = WS-COUNT-02CS + 1
ELSE
IF FILEA
MOVE SPACES TO MISSCS02-X-CUST-NO
MOVE FILEA-Y-CUST-NO TO MISSCS02-Y-CUST-NO
WS-COUNT-CS02 = WS-COUNT-CS02 + 1
PUT MISSCS02
END-IF
END-IF
FIN-PROC. PROC
DISPLAY WS-COUNT-02CS
DISPLAY WS-COUNT-CS02
END-PROC
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|