Posted: Mon Jan 20, 2020 2:46 pm Post subject: Combine values based on key with certain Output positioning
Good day,
please let me know how to accomplish the following task.
There is an Input dataset, FB, LRECL=100, where there could be different types of payments (13:4) assigned to the same key (52:15).
The goal is to combine all payments for each key on a single record, but place payments into certain positions on Output, based on their type.
I've tried SPLICE, but not all records came out correctly. Could that be because SPLICE identified each repeating value
by SEQNUM, and I need it by payment type in (13:4)?
kolusu, I ran your JCL, worked perfectly, thanks a lot.
And can I ask for a small change? I just learned that business also wants, besides the payment type, to see the entire value (1:16) from Input. I understand that it would change the Output layout, but that doesn't matter, I can always adjust those. I tried changing the NOMATCH value from hardcoded to positional, but it didn't work.
Thank you.
Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Tue Jan 21, 2020 10:30 am Post subject:
ramy2016 wrote:
kolusu, I ran your JCL, worked perfectly, thanks a lot.
And can I ask for a small change? I just learned that business also wants, besides the payment type, to see the entire value (1:16) from Input. I understand that it would change the Output layout, but that doesn't matter, I can always adjust those. I tried changing the NOMATCH value from hardcoded to positional, but it didn't work.
Thank you.
ramy2016,
what is the final output layout that you want? Make sure you gather all the information before asking another change. Specify the positions and lengths of the fields you want in output. _________________ Kolusu
www.linkedin.com/in/kolusu
what is the final output layout that you want? Make sure you gather all the information before asking another change. Specify the positions and lengths of the fields you want in output.
Something like in the code below. Input values from pos. 1:12 + 4 bytes pmt-type = 16 bytes (1:16).
Thank you.
kolusu,
The first 12 bytes are timestamps and amounts related to payments, so those would be different. And the dataset I'm working with doesn't have similar payment types within the same key. One cash, check, credit and debit per key.
Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Tue Jan 21, 2020 1:38 pm Post subject:
ramy2016,
Use the following DFSORT/ICETOOL JCL which will give you the desired results. I assumed your input is sorted on the key at position 52. If it is NOT sorted then remove the OPTION COPY statement in CTL1CNTL
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