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.
We have a joined file that has current transaction records and history records in it. When I am processing that file is there any way to determine which file the record is in? I need to process differently based on origin.
I checked the INFDS, but can find nothing there.
I figured if there was a way, someone here would know!
Thanks in advance!
Both files have the same format.
A R VEHPHY PFILE(PFVEHICLE PFHISTORY)
A K SBUYER
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.
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.
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?
Yes you are. Creat another logical that has select/omit to include only blank records and process it last (3rd iteration).