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
sinduja
Beginner


Joined: 20 Jun 2005
Posts: 29
Topics: 14

PostPosted: Tue Jun 28, 2005 12:41 am    Post subject: easytrieve - invalid file reference error Reply with quote

hi all

i am new to easytrieve.
i need some help.

my requirement is to read records from a file and check if it is trailer record.

code is as follows

get ipfile
do when not eof ipfile

if record-data EQ trailer-record
.....
.......
end if
end do

this one worked but
for some reason i dont want to check the end of fie in this way

so i used a flag to check eof condition

eof-flag eq 'n'
do while eof-flag = 'n'
get ipfile
if record-data EQ trailer-record
........
.........
end-if
if EOF ipfile
eof-flag EQ 'y'
end if

end do

is this right?
when i run this code i get error invalid file reference at the first IF condition

i dont know what could be the possible problem

can anyone help me with this

thank you.

regrds,
sinduja.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Jun 28, 2005 5:38 am    Post subject: Reply with quote

sinduja,

You get an invalid file reference if you reached your end-of file. Your first DO statement has got the eof condition and you are once again checking it which would cause an EOF condition.

It is always a good idea to let easytrieve control the EOF

Code:

JOB INPUT INFILE

IF record-data EQ trailer-record
   .....
   ...
END-IF


By coding like this you don't have to worry about the EOF. easytrieve will automatically take care of it

Hope this helps...

Cheers

Hope this helps...

Cheers

Kolusu
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