Subscribe to keep this site alive! Under new management but as always, still 100% FREE. Anyone with the IBM i is a friend of ours.
The Challenge: Why is my SAC segments not showing in the Mailbox and why are the record associated SAC loop Record Format (D03) not showing in the PED790P report?
The Solution: This illustrates the relationship of the location of the loops (record association) and your logical. When translation occurs, the map and the UFD (file) is read concurrently and sequentially.
Since you have chosen the Sequential Using Externally defined records:
the keys define the order of the records,
when the key values are the same (in the case of your H01, H02, H03 and D03, the order of the record format in your DDS or the Software's Logical File definition is followed.
In this case H01, H02, H03, D03 . . . D03, D01, D01, D01. These records (except for the D03’s) are reflected in the PED790P report you have submitted. The extra key defined after INVOIC for D01 has dragged the records of this record format after the last D03 record. This can be easily proven by viewing the logical EDIINS using DFU or DBU (in key order). If the you are not worried of the order of records within D01 and D03; you can easily fix this by removing the extra key of D01 – and theoretically, your D03’s will be brought over after the last D01 – making the D03 records appear in the PED790P report and your SAC segments will now be seen in your mailbox.
Here are some assumptions:
the UFD/logical file is read sequentially then the map.
But when it hits a loop with record association, it skips to that record format looping through the records then map until it hits the loop end; then reads the map side.
But since the D01 was the last record, when it is time to read the SAC loop, there are no records to be read on the UFD side – since the pointer is currently after the last D01 record; then reads the map side.
Do you have a new CHALLENGE? Let us know HERE.