|
I don't think you can. Instead you should process files B and C simultaneously. Read a record from both files, print, read from both files, print. If you get to end of file on one of them, you don't read that one anymore, but continue reading the other one until you get to the end of that file also. When you get to the end of both files B and C, then read your next record from file A and so on. Dawn Siegrist -----Original Message----- From: hrishikesh kotwal [mailto:hdkotwal@hotmail.com] Sent: Wednesday, November 07, 2001 12:02 PM To: rpg400-l@midrange.com Subject: Line count? [ Converted text/html to text/plain ] Dear all, I am writing a RPG III Report program using O-specs. Following is my problem: I read File A and print all records, with each record on a different line. Within this read loop, I read File B (File B may have one or more records matching with File A). Assume I print the first record from File A on Line 1. Then I read File B, find 3 records. Each record must be printed on a different line. In order to print these records from Line 1, I specify 0 spaces before new line is printed in the O-specs. This serves my purpose and I get the first record from File B on Line 1. then I go ahead and print the other 2 records from File B on Lines 2 & 3 respectively. BUT now there is another File C which also may have one or more records matching File A. These records also must be printed from Line 1. Because I have already printed records from File B, I have reached Line number 3. How do I get back to Line 1. and start printing data from File C? (I hope this makes sense???) Please help. Regards, Hrishikesh Kotwal >From: "Adam White" >Reply-To: rpg400-l@midrange.com >To: >Subject: RE: Close File >Date: Tue, 6 Nov 2001 07:27:13 -0000 > >Ok, >If you do an explicit CLOSE, the file WILL close. Unless, it is shared and >open in another program. > >Is it failing on the open with a CPF message? > >Why don't you just do a SETLL to reposition? Or are you using OPNQRYF or the >like? > >Regards >Adam White >adam@slic-systems.com >www.slic-systems.com/ > >-----Original Message----- >From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On >Behalf Of mohd khan >Sent: 05 November 2001 19:38 >To: rpg400-l@midrange.com >Subject: Re: Close File > > >Ok, here is the logic >I'm reading the file >when EOF occour I'm closing that file >but some how the file remain open >I want to reopen this file, because I want to read it again for the 2nd time >for the different Dept. > >The program was running fine from last two years, >No one changed it, I did checked the object >The program originally written in RPG/400 >our I.S dept. upgraded the ver, as well as hardware also, this change will >not effect the object ? right I'm not sure > > > >_______________________________________________ >This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list >To post a message email: RPG400-L@midrange.com >To subscribe, unsubscribe, or change list options, >visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l >or email: RPG400-L-request@midrange.com >Before posting, please take a moment to review the archives >at http://archive.midrange.com/rpg400-l. > ---------------------------------------------------------------------------- -- Get your FREE download of MSN Explorer at http://explorer.msn.com[1] ===References:=== 1. http://go.msn.com/bql/hmtag_itl_EN.asp _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.