Author: Bill Woodger
Subject: Reply to: Add PD field from 2nd file to PD in 1st
Posted: Fri Dec 02, 2016 2:35 pm (GMT 5.5)
Well, I'd recommend using the length. It is more typing for now, but it'll save lots of confusion in the long run (people have to look up in a manual how long the field will be while trying to check that the data is in the correct position, a silly thing to leave someone else to do).
Are you using SyncSORT? If not, use the "match marker", ?, for the REFORMAT record, and from F2 only include the data that you need from F2.
Test the match-marker position, and do the calculation only on a match (marker equal to B). Use IFOUTLEN=30 to drop off the excess bytes (match-marker and amount).
If you don't have access to the match-marker, you can work out whether you have a match or not, using a test for the "FILL" character that you have provided.
No need for two OUTFILs. No need for another step.
Also, if you use FILES=01, you don't need FNAMES=SORTOF01. Alternatively, specify a more description name for FNAMES.
Note that the F1,F2 are a "comment" in the JOIN you have shown, plus you get F1 and F2 mismatches anyway from UNPAIRED. F1 we know what you want with mismatches, what about F2 mismatches?
Subject: Reply to: Add PD field from 2nd file to PD in 1st
Posted: Fri Dec 02, 2016 2:35 pm (GMT 5.5)
Well, I'd recommend using the length. It is more typing for now, but it'll save lots of confusion in the long run (people have to look up in a manual how long the field will be while trying to check that the data is in the correct position, a silly thing to leave someone else to do).
Are you using SyncSORT? If not, use the "match marker", ?, for the REFORMAT record, and from F2 only include the data that you need from F2.
Test the match-marker position, and do the calculation only on a match (marker equal to B). Use IFOUTLEN=30 to drop off the excess bytes (match-marker and amount).
If you don't have access to the match-marker, you can work out whether you have a match or not, using a test for the "FILL" character that you have provided.
No need for two OUTFILs. No need for another step.
Also, if you use FILES=01, you don't need FNAMES=SORTOF01. Alternatively, specify a more description name for FNAMES.
Note that the F1,F2 are a "comment" in the JOIN you have shown, plus you get F1 and F2 mismatches anyway from UNPAIRED. F1 we know what you want with mismatches, what about F2 mismatches?