Requirement: The input file has 1 HD record, 1 DB record and multiple DT records. The output should only contain the group of records that has atleast one DT record. As we can see in the output, the second group did not have a DT record, so it shouldn't be in the output.
As usually, the question is not in SYNCSORT or whatever else, but: in the ability of developer to evaluate the logical algorithm - what is the sequence of operations for the task to be done, at all?
After the problem above is resolved, then the appropriate tool could be chosen.
Doesn't make any sense to do it vice versa.
If the data set is Not too big then, as a simple solution, you can read the data set in reverse using SEQ and use WHEN=GROUP where the Group BEGIN with 'DT' record and END with 'HD' record. At the end, reverse the order again to get your expected output.
Posts about ICETOOL under SYNCSORT, and vice versa, are prohibited by moderators (for unknown reason), isn't it?
That is not true. But posting solutions that are not compatible with the other product is not recommended and such posts could be edited/removed.
Syncsort has made 'ICETOOL' an alias to their product - 'SYNCTOOL'. So PGM=SYNCTOOL and PGM=ICETOOL can be used interchangeably at a typical Syncsort site unless there are any site specific restrictions.