× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



If you know the RRN of the SFL record, you can

SFLRRN   CHAIN  SFL

to read the same SFL record again. Perhaps in the INFDS.

Regards,
Carel Teijgeler

On 13-5-2015 18:40, Roche, Bob wrote:
But the READC is already past that record so it won't read it again until you EXFMT(write/read) the subfile. At least I never got it to work without doing that.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Carel Teijgeler
Sent: Wednesday, May 13, 2015 11:20 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: SFLNXTCHG head-scratcher

Dan,

The right order is:

READC
SFLNXTCHG = *ON
UPDATE SFL
SFLNXTCHG = *OFF


Regards,
Carel Teijgeler

On 13-5-2015 17:17, Dan wrote:
It's been several years... meh, a decade since I last worked with
subfiles prior to this job I started a few months ago.

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
program, 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 the
workstation file is a READC on the subfile.  Does there need to be an
intervening EXFMT / WRITE of the subfile control record?  I tried a "1
SETLL  MAPTRA1S" after the update above, but the compiler isn't buying it.
(Also tried *LOVAL in factor 1.) Here is the code with the EOF test:

       C                   READC(E)  UGLTRA1S
       C                   DOW       %EOF = *OFF

Given the earlier code, I would have expected the READC to find the
updated record, but debug is showing that %EOF is *on, and is skipping
the DOW group.

Ideas, advice appreciated!

- Dan

--
This is the RPG programming on the IBM i (AS/400 and 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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.