|
You have that chain outside of the DO loop. You will always get RRN number 1. Assuming RRN has the total number of records in the subfile, I'd do this: If rrn > 0; // skip the whole thing if no records in subfile For Wrkrrn = 1 to rrn; Chain wrkrrn mysubfile; if %found(mydisplay); // should always be true If *IN99; // or whatever your PRTF overflow indicator is write heading; endif; write detail; // print a detail line Endif; Endfor; Endif; Francis Lapeyre IS Dept. Programmer/Analyst Stewart Enterprises, Inc. Voice: (504) 729-1468 or (800) 257-1610, ext. 1468 FAX: (504) 729-1457 E-mail: flapeyre@xxxxxxxx -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Brian Piotrowski Sent: Thursday, October 13, 2005 12:20 PM To: RPG programming on the AS400 / iSeries Subject: Printing a Subfile - Revisited Hi All, I have a new program that reads from a physical file and populates a subfile. I would like to use the contents of the subfile and print out a report. In my D-Specs, I have RRN 4 0 INZ and also WrkRRN Like(RRN). In my subroutine, I do this: Wrkrrn = 1; Write heading; Chain wrkrrn mysubfile; Dow %found(mydisplay); ... process ... Wrkrrn = Wrkrrn + 1; Enddo; However, the system automatically jumps over the DoW statement and doesn't print out any details. I have checked the value of RRN when it enters this subroutine, and the value of RRN is equal to the amount of records in the subfile. However, I believe that when this routine is executed, it is already at the end of the recordset, and the details aren't printed. Does anyone have any ideas what might be wrong in this situation? Thanks! Brian. -=-=-=-=-=-=-=-=-=-=-=-=-=- Brian Piotrowski Specialist - I.T. Simcoe Parts Service, Inc. Ph: 705-435-7814 x343 Fx: 705-435-6746 bpiotrowski@xxxxxxxxxxxxxxx -=-=-=-=-=-=-=-=-=-=-=-=-=- -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx 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.