Hi my input file looks as below
Y adghfdhfe 56 shdghjhfhjs
C dhchhhhht d7 dgghjhfhhf
Y ghfhhvvhb f2 cvbbbbnjhg
C dvvbhhfffd 5n fghhjjjjjjhf
Y fdjfufftghrg 56 ghgffgghhf
C fhgvfhhcdff D7 ghcghhjjj
Y cvvccvvvvv 45 chcxghggh
C gggcvvvvhb. Fg ghhjjjhhjjg
I want to group record with Y & C and my key is the combination of two character in middle from both Y & C. My output should give only the unique combination of the keys along with the record.
It should look like
Y adghfdhfe 56 shdghjhfhjs
C dhchhhhht d7 dgghjhfhhf
Y ghfhhvvhb f2 cvbbbbnjhg
C dvvbhhfffd 5n fghhjjjjjjhf
Y cvvccvvvvv 45 chcxghggh
C gggcvvvvhb. Fg ghhjjjhhjjg
It's like unique key combination of all the records.the vale in first character is constant and the position of key is same in both Y and C
Can we do this in sync sort
Regards,
Erick
Remove duplicates in group record using key combination
Re: Remove duplicates in group record using key combination
For this I am having the idea of
1) grouping this record
2) Append the keys like 56d7 in all the record
3) sort to remove the duplicate
I don't know the commands for sure
Can any one help me out
1) grouping this record
2) Append the keys like 56d7 in all the record
3) sort to remove the duplicate
I don't know the commands for sure
Can any one help me out
- Akatsukami
- Global moderator
- Posts: 1058
- Joined: Sat Oct 16, 2010 2:31 am
- Skillset: Rexx, JCL, DB2/SQL, TSO/ISPF, PL/I
- Referer: ibmmainframes
- Location: Bloomington, IL
- Contact:
Re: Remove duplicates in group record using key combination
Do you indeed wish "d7" and "D7" is be judged identical, or is that a typo?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
-
- Global moderator
- Posts: 3805
- Joined: Tue Jan 25, 2011 12:02 am
- Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
- Referer: Google
Re: Remove duplicates in group record using key combination
To confirm that, d7 and D7 should be treated as the same? Which do you want on the output when this case arises? d7 or D7 by value, or that which is physically first/last on the file?
I think you are almost there with your suggested outline. What is the REFCM and LRECL?
I think you are almost there with your suggested outline. What is the REFCM and LRECL?
Re: Remove duplicates in group record using key combination
d7 or D7 both are same. Let me put my requirement again
Group the first two record, a record has 2 from input file in order. First record starts as Y and the
The second one starts with C.
Key is in middle of two records. Consider If the first has AA and the second has BB. Then the key for the group is AABB.similarly we need to group all the records and the final out put is the unique combination of keys and its associated records for the first occurance.
In my example we have 56d7 and 56D7 both key are identical . I need any one of its associated record, if it is 56d7 output is 1st group I.e 1st and 2nd record. If it is 56D7 the output should have only 5th and 6 th record . I need any one of 56d7 combination. Hope this clarifies. Consider rec length as 80
Group the first two record, a record has 2 from input file in order. First record starts as Y and the
The second one starts with C.
Key is in middle of two records. Consider If the first has AA and the second has BB. Then the key for the group is AABB.similarly we need to group all the records and the final out put is the unique combination of keys and its associated records for the first occurance.
In my example we have 56d7 and 56D7 both key are identical . I need any one of its associated record, if it is 56d7 output is 1st group I.e 1st and 2nd record. If it is 56D7 the output should have only 5th and 6 th record . I need any one of 56d7 combination. Hope this clarifies. Consider rec length as 80
-
- Similar Topics
- Replies
- Views
- Last post
-
-
eliminate duplicates with different data
by cobol_dev » Fri Jun 03, 2022 3:47 am » in DFSORT/ICETOOL/ICEGENER - 7
- 1891
-
by cobol_dev
View the latest post
Wed Jun 15, 2022 10:44 pm
-
-
- 1
- 2359
-
by sergeyken
View the latest post
Fri Jun 03, 2022 2:49 am
-
- 4
- 2266
-
by sergeyken
View the latest post
Mon Jun 26, 2023 12:56 am
-
-
Copy partial record after a string in a record using SORT.
by Esmayeelhusen » Thu May 04, 2023 3:03 pm » in DFSORT/ICETOOL/ICEGENER - 16
- 4361
-
by Esmayeelhusen
View the latest post
Mon May 22, 2023 3:50 pm
-
-
-
GROUP ID FOR TTY CANNOT BE OBTAINED.
by aarvalar1 » Sun Oct 20, 2024 11:03 pm » in Mainframe Security - 2
- 1780
-
by aarvalar1
View the latest post
Tue Nov 05, 2024 9:25 pm
-