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



Buck,

After coding a MR program from scratch that seemed a LOT easier than 
trying to use either traditional RPG or SQL and I'm fearless.

Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 




"Buck" <buck.calabro@xxxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
11/26/2003 03:39 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
rpg400-l@xxxxxxxxxxxx
cc

Fax to

Subject
Re: RPG Cycle Newbie






> These 2 files have parent/child relationships in them.
> I'm trying to figure out which parent/child relationships
> are in FILEA, but not in FILEB and vice versa.
-snip-
> And finally, Can the RPG cycle be used in a
> sub procedure?

By definition, a sub-procedure has no cycle code.

Anyway, your question about using primary/secondary files for this purpose
will lead you to matching record.  Without MR, primary/secondary files 
work
like an old card reader: read all the records in the primary bin, then all
the records in the secondary bin.  Matching records is what drives the 
card
reader to read a primary and then a secondary, in an (almost) alternating
fashion.  I seriously doubt that you want to go there as a cycle newbie.
(Please note that I know, use and like MR and this is not an editorial
against it's use.  If you want to use the cycle for this job, read up on
matching record.)

The non-MR means of doing this involves reading all the records from FILEA
and CHAIN to FILEB.  Whether you find a match or not will determine one 
half
of the parent/child relationships.  Then, pass through FILEB and CHAIN to
FILEA.  You can do it all in one program if you define the two files as 
IF.
You can SETLL FILEA, set up a READ look and CHAIN to FILEB.  Then do the
same thing with the names exchanged.

Of course, if this is a one-time chore, SQL or Query will suffice.  I know
you said you don't have SQL, but you have QMQRY, which gives you the power
of SQL at the command line.  It's in the FAQ, I think.

I hope this was helpful.
  --buck



_______________________________________________
This is the RPG programming on the AS400 / 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 ...

Follow-Ups:
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.