MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Easytrieve - invalid file reference error

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
satheeshs
Beginner


Joined: 06 Jul 2006
Posts: 13
Topics: 3
Location: 'Mainframe World'

PostPosted: Tue Jul 11, 2006 9:11 am    Post subject: Easytrieve - invalid file reference error Reply with quote

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. Rolling Eyes

Cheers
_________________
Satheesh
Back to top
View user's profile Send private message Yahoo Messenger
satheeshs
Beginner


Joined: 06 Jul 2006
Posts: 13
Topics: 3
Location: 'Mainframe World'

PostPosted: Tue Jul 11, 2006 9:14 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Jul 11, 2006 9:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
satheeshs
Beginner


Joined: 06 Jul 2006
Posts: 13
Topics: 3
Location: 'Mainframe World'

PostPosted: Tue Jul 11, 2006 9:29 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Jul 11, 2006 10:04 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group