View previous topic :: View next topic
|
Author |
Message |
Deep S
New User
Joined: 16 May 2023 Posts: 8 Location: India
|
|
|
|
Hi All,
Thanks in advance for giving your valuable time.
I have a requirement where for a key I will have multiple rows. I won’t be knowing in advance that for which key how many rows will be. It could be one , 3, 10, my need is to create a single row for a key in output along with other details from the other rows.
For example
This is how Input would be
KEY NAME ID
KEY1 ABCD 102
KEY1 EFGH 201
KEY2 XYZA 301
KEY3 SSSS 111
KEY3 ABCD 545
KEY3 FDGH 345
And so on
Expected output in this case would be
KEY1 ABCD 102 EFGH 201
KEY2 XYZA 301
KEY3 SSSS 111 ABCD 545 FDGH 345 |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
1. Try to be polite to possible readers of your post:
Deep S wrote: |
Hi All,
Thanks in advance for giving your valuable time.
I have a requirement where for a key I will have multiple rows. I won’t be knowing in advance that for which key how many rows will be. It could be one , 3, 10, my need is to create a single row for a key in output along with other details from the other rows.
For example
This is how Input would be
Code: |
KEY NAME ID
KEY1 ABCD 102
KEY1 EFGH 201
KEY2 XYZA 301
KEY3 SSSS 111
KEY3 ABCD 545
KEY3 FDGH 345
|
And so on
Expected output in this case would be
Code: |
KEY1 ABCD 102 EFGH 201
KEY2 XYZA 301
KEY3 SSSS 111 ABCD 545 FDGH 345 |
|
2. Do you know the maximum limit of expected equal keys?
If not, there is no (reasonable) solution for this problem. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1335 Location: Bamberg, Germany
|
|
|
|
Also to add, there are some samples in this forum covering this. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
Hint:
Search for examples of using SPLICE statement of ICETOOL/SYNCTOOL (both programs use the same syntax; you can borrow one example from another) |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
P.S.
It is a very bad idea to give the topic name like
This issue has nothing to do with JCL language.
It is completely SORT utility control statements discussion. |
|
Back to top |
|
|
Deep S
New User
Joined: 16 May 2023 Posts: 8 Location: India
|
|
|
|
Thanks for advise.
Maximum limit for a key would be 10. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
Hint #2.
In case you do not have any manual on the tool you are going to use (very strange situation!), you can try to check this online copy of DFSORT/ICETOOL manual:
DFSORT Application Programming Guide
Please, refer to Example 4 on page 648. This covers 95% of your particular task. |
|
Back to top |
|
|
|