Should work. That's basically how I check for changes during file
maintenance without putting a lock on the file. That is, read the record
into a DS on the first CHAIN(n), then re-CHAIN to DS2 and compare the two to
see if someone else was quicker.

Jerry C. Adams
IBM i Programmer/Analyst
The scientific unit of beauty is the millihelen, defined as the amount of
beauty to launch one ship. -EUI
A&K Wholesale
Murfreesboro, TN

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Tuesday, May 01, 2012 2:09 PM
To: Midrange Systems Technical Discussion
Subject: Re: Stupid question

Something about reading the file into a datastructure comes to mind.
Define an externally defined data structure for each file.
chain ('abc' : 'AB') custRec custRecDs;
Then compare the two data structures.

Rob Berendt
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail
to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755

From: John McKee <jmmckee@xxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,
Date: 05/01/2012 02:54 PM
Subject: Stupid question
Sent by: midrange-l-bounces@xxxxxxxxxxxx

I posted this (I think - never get emails from posting) to the RPG
list. Never received a reply.

I have two files. Different names, formats, and field names.

One is produced early in the day.

I need to remove records from the second file that are identical to
those in the first file. Thus, second file only has new and changed

I am stuck on how to set up a comparison of the entire record from
each file. I know I have done this, many years ago, but my brain is
just too foggy. I just don't want to have an IF with 90+ field

Logic is simple - read file 2, attempt to chain to file 1. No chain -
a new record. If chain is successful, compare the two records. If
same, delete record from file 2.

I can't directly compare the record formats. How do I define a single
field over each record?

I tried I-Specs - File name followed by single field name..

Dumb question. Thanks for a nudge.

John McKee

This thread ...


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

This mailing list archive is Copyright 1997-2020 by 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].