|
Nope. The reason that you are having the problem is because the program is using rrn field as relative record of subfile (SFILE(format:rrn) and positioning of the subfile (SFLRCDNBR keyword). When you read the subfile record, the system change the rrn to the relative record number of the subfile the program just read, which cause the display positioning to work. >From experience, using the same field for SFILE and SFLRCDNBR keywords >normally cause program to be harder to maintenance. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Marvin Radding Sent: Tuesday, August 09, 2005 3:11 PM To: RPG programming on the AS400 / iSeries Subject: RE: Subfile Record positioning So I guess you have to read the subfile record in order for the subfile to be displayed at the proper position. Go figure. Marivn -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tyler, Matt Sent: Tuesday, August 09, 2005 12:44 PM To: 'RPG programming on the AS400 / iSeries' Subject: RE: Subfile Record positioning Marvin, Do this (I do and have not issues); 1. Make the F-spec SFILE(SUBFILE:RRN) and only use it to load the sub file and populate another field to hold the total number of records written to the sub file (MAXRRN). RRN will get reset to the sub file record for chains and readc even if you do not use it to process with. I even use another field for chaining to the sub file, since its value getting reset has caused me problems. 2. For keyword SFLRCDNBR() use a separate field like POSRRN. Populate it right after EXFMT to the control by: ... EXFMT SUBFCNTL IF CSRRN > 0 EVAL POSRRN = CSRRRN ELSE EVAL POSRRN = LOWRRN ENDIF ... The through out the program, if you read the sub file detail and need to position to a specific record, EVAL POSRRN = sub file record #. Just before you EXFMT to the sub file control to prevent errors with POSRRN outside actual number sub file detail records: ... IF POSRRN <=0 or POSRRN > MAXRRN EVAL POSRRN = 1 ENDIF EXFMT SUBFCNTL ... 3. You will continue to use the SFLCSRRRN(&CSRRRN). 4. Code a INFDS mapping like D INFDSPF DS D LOWRRN 378 379I 0 LOWRRN position is the first record shown on the screen. With different fields containing a RRN value for different keywords and file operations you can more easily see what a value of one of the fields is going to be at EXFMT time. Also, check to make sure you do not having DSPATR(PC) set on for fields in the control record. The cursor will get positioned there and subsequent page operations will result in CSRRRN being zero. Thank you, Matt Tyler WinCo Foods, LLC mattt@xxxxxxxxxxxxxx -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Marvin Radding Sent: Tuesday, August 09, 2005 12:56 PM To: RPG programming on the AS400 / iSeries Subject: RE: Subfile Record positioning Yes, I have the rrn properly defined in the program. Marvin -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai Sent: Tuesday, August 09, 2005 11:34 AM To: RPG programming on the AS400 / iSeries Subject: RE: Subfile Record positioning is rrn field in the display file F spec, keyword SFILE(format :rrn)? If so, somewhere in your code you must have done a readc, which will change the rrn to change. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Marvin Radding Sent: Tuesday, August 09, 2005 1:28 PM To: RPG programming on the AS400 / iSeries Subject: RE: Subfile Record positioning I have another clue. If I enter a space in a field for the record that the cursor is on, then the subfile is positioned at the proper record. If I just press enter or press an Fkey, then it go to record 1. And no, the only Fkey set to CA is F03, all other are CF. Marvin -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai Sent: Tuesday, August 09, 2005 11:24 AM To: RPG programming on the AS400 / iSeries Subject: RE: Subfile Record positioning if your program is not updating the field, it should stay as 1. Am I missing something? -----Original Message----- From: rpg400-l-bounces+lim.hock-chai=usamobility.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+lim.hock-chai=usamobility.com@xxxxxxxxxxxx]On Behalf Of Marvin Radding Sent: Tuesday, August 09, 2005 12:38 PM To: RPG programming on the AS400 / iSeries Subject: RE: Subfile Record positioning 1. before any other action is taken it is 1. 2. after paging through the unfolded screen to record 5, pressing the F10 key, the rrn is still 1 3. before the redisplay, it is still 1 Marvin -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement Sent: Tuesday, August 09, 2005 10:29 AM To: RPG programming on the AS400 / iSeries Subject: RE: Subfile Record positioning > A RRN 4S 0H SFLRCDNBR(CURSOR *TOP) And what is the value of the above RRN field at the time that exfmt the SFLCTL record?
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.