PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

diff between %equal & %eof

View previous topic View next topic Go down

diff between %equal & %eof

Post  muthuraman on Thu Oct 29, 2009 5:15 pm

Could you please enlighten me if %eof() followed by reade or %equal followed by reade is appropriate and which is the IBM standard?

Regards,
Muthuraman

muthuraman

Posts : 42
Join date : 2009-08-28

View user profile

Back to top Go down

Re: diff between %equal & %eof

Post  swaminathan on Mon Dec 14, 2009 6:29 pm

%EOF can be used to check for end-of file, beginning of file, or subfile full conditions. A READ and READE return %EOF=*ON if the end of file is reached. READP and READPE return %EOF=*ON if the beginning of file is reached. The WRITE operation returns %EOF=*ON if the WRITE operation to a subfile detail record returned a subfile-full condition.

%EQUAL is used by the SETLL operation to indicate that it detected a record in the file with a key equal to that of the value specified in Factor 1. Since SETLL does not read the record, does not lock the record, and does not copy the data into the input buffer, SETLL is much faster and less of an impact on the performance of the application than other operations, such as CHAIN. Use CHAIN when you need to retrieve the record, use SETLL and %EQUAL when you need to only check for the existence of a record.

so %eof followed by Reade is good standard..

Correct me if i am wrong..

swaminathan

Posts : 12
Join date : 2009-07-30

View user profile

Back to top Go down

Re: diff between %equal & %eof

Post  anandh on Mon Dec 14, 2009 7:15 pm

I agree with Swaminathan.

anandh

Posts : 1
Join date : 2009-08-26

View user profile

Back to top Go down

Re: diff between %equal & %eof

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum