Midrange News for the IBM i Community


Posted by: Jayaprakash Balasubramanian
READ Records in RPG
has no ratings.
Published: 30 Dec 2011
Revised: 23 Jan 2013 - 4103 days ago
Last viewed on: 17 Apr 2024 (5620 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

READ Records in RPG Published by: Jayaprakash Balasubramanian on 30 Dec 2011 view comments(3)

I have 25 records in PF. I want to READ records from 10 to 20 only. How is it possible in RPG? Kindly help me

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: neilrh
Premium member *
Jackson, MI
Comment on: READ Records in RPG
Posted: 12 years 3 months 20 days 12 hours ago

Do not define the file as keyed, then use relative record processing.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: READ Records in RPG
Posted: 12 years 3 months 20 days 5 hours 37 minutes ago

Do what Neil said, and then CHAIN to record 10 and continue reading until you hit record 20.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: READ Records in RPG
Posted: 12 years 3 months 20 days 3 hours 26 minutes ago

Of course this only works if the records on file are actually RRN 1-25.

If you just have 25 records on the file but cannot guarentee that there are no deleted records.  Then you have to read each record and determine when you reach 10 and then keep going until you get to 20.