|
----- Message from Jeff Young <jyoung0950@xxxxxxxxx> on Fri, 15 May<rpg400-l@xxxxxxxxxxxx>
2015 16:46:07 -0400 -----
To:
"RPG programming on the IBM i (AS/400 and iSeries)"
subfile
Subject:
Re: SFLNXTCHG head-scratcher
Michael,
I have used both methods in the past, but unfortunately, the SFLNXTCHG
function only tells you that the MDT for at least one field on the
record has been changed, not that the actual data was changed.Then I
Jeff Young
Sr. Programmer Analyst
On Fri, May 15, 2015 at 4:21 PM, <MichaelQuigley@xxxxxxxxxx> wrote:
I do what you're trying to do all the time--it's one of my standard
subfile processing methods.
First, I read through all the changed records and validate the
options/input, set the SFLNXTCHG on, and update the subfile record.
%EOFread through them and process them. But in-between, I reset the RRN
(RRNSF1 in your case) to zero. If you don't, then you immediately get
canas there are no more records to process.
It doesn't require IO on the control record, or other finagling. You
OSuse hidden fields and do your own comparisons, but why rewrite a basic
12:56:25function? Go down that path and you can end up writing a bunch of code
that the OS already handles for you.
"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 05/13/2015
thePM:
----- Message from Dan <dan27649@xxxxxxxxx> on Wed, 13 May 2015 11:subfiles
17:23 -0400 -----
To:
RPG400-L@xxxxxxxxxxxx
Subject:
SFLNXTCHG head-scratcher
It's been several years... meh, a decade since I last worked with
prior to this job I started a few months ago.program,
Have a situation where SFLNXTCHG is not working as I expect it to.
DSPF:
A R MAPTRA1S SFL
A 39 SFLNXTCHG
RPGLE:
FMAPTRADF CF E WORKSTN INFDS(INFDS)
F SFILE(MAPTRA1S:RRNSF1)
F INDDS(DS@INDDS)
...
D DS@INDDS DS
d SflNxtChg 39 39n
...
*** A field defined in the subfile record is updated by the
then...
c Eval SflNxtChg =
*on SFLNXTCHG (for READC
C UPDATE MAPTRA1S
c Eval SflNxtChg =
*off SFLNXTCHG reset
---> At this point, should a READC pick up the record that was just
updated? In the program I'm modifying, the next I/O operation on
anworkstation file is a READC on the subfile. Does there need to be
"1intervening EXFMT / WRITE of the subfile control record? I tried a
buyingSETLL MAPTRA1S" after the update above, but the compiler isn't
DOWit.
(Also tried *LOVAL in factor 1.) Here is the code with the EOF test:updated
C READC(E) UGLTRA1S
C DOW %EOF = *OFF
Given the earlier code, I would have expected the READC to find the
record, but debug is showing that %EOF is *on, and is skipping the
(RPG400-L)group.--
Ideas, advice appreciated!
- Dan
This is the RPG programming on the IBM i (AS/400 and iSeries)
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.
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) digest 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.