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 - 1585 days ago
Last viewed on: 27 May 2017 (3243 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: 5 years 4 months 29 days 12 hours 52 minutes 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: 5 years 4 months 29 days 6 hours 28 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: 5 years 4 months 29 days 4 hours 17 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.