Sorting groups with several headers

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
Martin G.
Member
Posts: 7
Joined: Thu Mar 11, 2010 6:39 pm

Sorting groups with several headers

Post by Martin G. » Thu Mar 11, 2010 7:19 pm

Hello,

sorting a file raised some problems, I could not solve so far.
The file is 132 fb and looks like follows:

HDR1 nnnn
HDR2 zzzzzzzzzz
(several info-records)
HDR2 yyyyyyyyy
(several info-records)
HDR1 dddd
HDR2 xxxxxxxxx
(several info-records)
HDR2 wwwwwww
(several info-records)
HDR2 qqqqqqqq
(several info-records)
HDR1 aaaa
and so on.
-
HDR1 is a 4-byte and HDR2 a 22-byte numeric value.
I have a variable number of info-records in each HDR2-group and a variable number of HDR2-records in each HDR1-group. It is possible, that a group with a HDR1 already known appeares later in the file again with different HDR2-goups.
This file should be sorted HDR1- by HDR1-group and in between each HDR1 by HDR2-groups with the (unsorted) info-records for each HDR2.
I tried a lot using ICETOOL and SPLICE with some sucess, but I never could combine splice results on HDR1 and HDR2.
Any help to let me reach the result file I need?
Thanks a lot in advance!

skolusu
Member
Posts: 43
Joined: Sat Jul 26, 2008 12:38 am

Post by skolusu » Thu Mar 11, 2010 9:44 pm

Martin.G,

Look at the smart DFSORT Trick "Sort groups of records" here


http://www.ibm.com/support/docview.wss? ... g3T7000094
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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