IBM AS400 Question: Download IBM AS400 PDF
How to search particular records from the database file in RPG?
Suppose, there are 100 records in the file.i need to retrieve all the records matching/equal to the particular NAME field. How can we do the above using SEARCH criteria other than using the IF cond?
Answers:
Answer #1This can be done using the Key Field.
KEY1(NAME FIELD) SETLL FILENAME
KEY1(NAME FILED) READE FILENAME
KEY1(NAME FIELD) SETLL FILENAME
KEY1(NAME FILED) READE FILENAME
Answer #2We can use a Key Field and use chain to search for the perticular record it will work similar to SETLL with READE.
KEY CHAINFILENAME
KEY CHAINFILENAME
Answer #3we can use chain concept and other then if condition means we can use DOW.