Midrange News for the IBM i Community


Posted by: Danny Hayes
Record origin determination on Joined LF
has no ratings.
Published: 08 Nov 2012
Revised: 23 Jan 2013 - 1611 days ago
Last viewed on: 22 Jun 2017 (2638 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Record origin determination on Joined LF Published by: Danny Hayes on 08 Nov 2012 view comments(5)

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: DannyFromOP
Premium member *
Comment on: Record origin determination on Joined LF
Posted: 4 years 7 months 13 days 23 hours 37 minutes ago

Both files have the same format.

A          R VEHPHY                    PFILE(PFVEHICLE PFHISTORY)
A          K SBUYER                                             

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Record origin determination on Joined LF
Posted: 4 years 7 months 13 days 22 hours ago

That's a UNION.

Normally the INFDS (assuming you are using the READ opcode to read the records) will reflect the file name. I know when you do an OVRDBF xxx TOMBR(*ALL) it shows you the current member name. Perhaps the member name is the only thing updated--maybe look at that instead of the file name.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Record origin determination on Joined LF
Posted: 4 years 7 months 13 days 5 hours 24 minutes ago

Are you stuck with this LF? You might need to create a multi-format LF:

     A          R VEHPHY                    PFILE(PFVEHICLE)
     A          K SBUYER
     A          R HSTPHY                    PFILE(PFHISTORY)
     A          K SBUYER

With a multi-format LF, you can use the INFDS to get the format name you just read (in my example, 'VEHPHY' vs. 'HSTPHY'). Once you know the format name, you know which PFILE.

Posted by: DannyFromOP
Premium member *
Comment on: Record origin determination on Joined LF
Posted: 4 years 7 months 12 days 23 hours 7 minutes ago
Edited: Fri, 09 Nov, 2012 at 14:20:22 (1686 days ago)

Thanks for your replies, I had to lose the join file and just process one time with each physical.

Now they want to sort all blanks to the end, I told them they would have the records in reverse order.  Have I remembered incorrectly?  Is there a way to accomplish this in some other manner?

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Record origin determination on Joined LF
Posted: 4 years 7 months 12 days 15 hours 12 minutes ago

Yes you are. Creat another logical that has select/omit to include only blank records and process it last (3rd iteration).