× 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.



L1 is going to come on AFTER the record with the new control field is
read, but before the data is moved to the input fields.

I'd save the key information (or RRN) for each record at detail time. At
L1 total time, chain using either the saved key data or the RRN to a
second copy of your primary file and update the data required. Be certain
to setup different field names between the two records, so you don't
overwrite your data fields.

Steve
- -
Steven Morrison
Fidelity Express





Robert Nesiba <bob@xxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
04/23/2009 04:39 PM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: Update primary filre






Probably the infDS, in lieu of look-ahead, might work
but our program has a bunch of total time L1 calculations,
and I don't want to make any major changes to the overall
program logic.

We're probably going to have to leave our primary file as input,
and then add another file spec for update, either updating a new logical
file
or using OVRDBF to point to the same file.
Any reason that won't work?
Thanks.

Asher613Smith@xxxxxxx wrote:
\You can use "look ahead" without an I-Spec. The INFDS has the key of
the
next record, if I remember correctly, somewhere around position 401. You

just need to add an INFDS to the primary file F-spec, and then add the
DS,
specifying the fields.

e.g. Assuming the key is field1 (10A) and field2 (5A)

FPrimary IP K InfDS(PrimaryDS)

D PrimaryDS DS
D nextKeyFld1 401 410
D nextKeyFld2 411 415
D nextKey 401 415

then, check
if nextKeyField1 > field1 or nextKeyField2 > field2 ;

(you only have to check for >, not <>).

If you specify field1 and field 2 in a DS, you could also check

D currKey DS
D field1
D field2


if nextKey > currKey ;




In a message dated 4/23/2009 11:51:43 P.M. Jerusalem Daylight Time,
booth@xxxxxxxxxxxx writes:

Oh man, am I going to hate myself for this.

You want to use LOOKAHEAD in your i specs. The lookahead field gives
you the fields you are interested in before you actually read the
record. That way you can Look ahead" and see if the next record is in
this set or the next set.


I haven't used lookahead for 30+ years, but its probably still
available?




Robert Nesiba wrote:

We have an old, large program (that we don't want to rewrite) which
processes a primary file and a secondary file using L1 M1 processing.
Both files are currently input only, and externally defined. At L1
total time an answer is calculated that we want to write back into the

primary file. When we change the primary to update capable, the L1
answer gets written into the subsequent record. We have tried both
UPDATE and EXCEPT, and get the same result: data updates the wrong
(subsequent) record. What's the best (or the easiest way) to update
the
correct primary file record? Thanks!



------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.12.3/2076 - Release Date:

04/23/09 06:30:00




--
---------------------------------
Booth Martin
http://www.Martinvt.com
---------------------------------

--
This is the RPG programming on the IBM i / System i (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.



**************Access 350+ FREE radio stations anytime from anywhere on
the
web. Get the Radio Toolbar!
(http://toolbar.aol.com/aolradio/download.html?ncid=emlcntusdown00000003
)



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.