Posted: Tue Aug 23, 2016 11:48 am Post subject: Data reassignment in DFSORT.
Hi, I have a sequintial file, FB, LRECL=77
File has DEST-ID (1:11) and TRANS-RCPT (68:10) fields.
DEST-ID is mandatory, where TRANS-RCPT may or may not have value.
I need to search the entire file, find matching TRANS-RCPTs, and move all records from DEST-ID "B" of a matching pair
to DEST-ID "A", assigning them all DEST-ID "A" value. There could be more than 2 matches on the same TRANS-RCPT.
Also, the rest of records that either didn't have matching TRANS-RCPT or have no value in that field at all, should also
be placed into output seq. dataset, so the output has the same number of records as input.
Is something like that possible with DFSORT?
Thanks.
kolusu, the main idea here is that upon match on TRANS-RCPT, records should get included under the same DEST-ID, regardless
of their order within DEST-ID group.
Thia is what should happen.
1.record-2 from DEST-ID ZZR19984M15 that had a TRANS-RCPT of 0000000106 got matched to the record-3 having the same TRANS-RCPT.
record-3 from DEST-ID QQWM998401W got moved to the DEST-ID ZZR19984M15.
record-10 from DEST-ID VNSEPP1112A also got matched on TRANS-RCPT of 0000000106, so it got moved to the DEST-ID ZZR19984M15.
remaining record-11, record-12 from DEST-ID VNSEPP1112A also became ZZR19984M15.
2.record-4 from 78N74B332TT matched on TRANS-RCPT of 0000000113 to record-8 from 8CNMN43489H
record-8 went from 8CNMN43489H to 78N74B332TT, resulting in
3.record-6 from 876HAGS5S26 didn't have a matching TRANS-RCPT, so no changes there - goes to the output.
4.record-7 from LLKJ487HJAS didn't have a matching TRANS-RCPT, so no changes there - goes to the output.
5.record-9 from 653244BNBSA didn't have a matching TRANS-RCPT, so no changes there neither - goes to the output.
By DEST-ID "A" and DEST-ID "B" I meant to indicate the 1st and 2nd entities in a matching pair.
For ex.
DEST-ID "A" - ZZR19984M15 record-2 0000000106
DEST-ID "B" - QQWM998401W record-3 0000000106
where upon match, they both get DEST-ID "A" value of ZZR19984M15.
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Wed Aug 24, 2016 11:44 am Post subject:
ramy2016,
Do you need to retain the original order of the records for the space records or is it okay if the values are transposed for the mathcing TRANS-RCPT? If you need the original order then you need 2 passes of data. _________________ Kolusu
www.linkedin.com/in/kolusu
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum