Sort help

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
karthi5555
Member
Posts: 6
Joined: Tue Dec 01, 2015 11:59 pm

Sort help

Post by karthi5555 » Wed Dec 02, 2015 12:27 am

can you please help with this sort situation.
Removing the duplicates within the group's 'DTL' record.

Please note:
1) The record must NOT be sorted i.e position should be kept
2) removal of duplicate within the HDR-DTL segment group only
3) number of HDR/DTL records are dynamic.

I tried traditional way of adding the SEQ-NBR to the end and removing duplicates - it did not work. Also, tried sort XSUM to get the duplicates and joining with original file even that did not work.

Any help/directions is highly appreciated.

Input file:

HDR837
DTL1234
DTL4567
DTL7890
DTL1234
DTL4567
HDR837
DTL4567
DTL1234
DTL4567
HDR837
DTL1234
HDR744
DTL9999

Expected output file:

HDR837
DTL1234
DTL4567
DTL7890
HDR837
DTL4567
DTL1234
HDR837
DTL1234
HDR744
DTL9999

Thanks,
Karthik.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others