how to separate set of records using DFSORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

how to separate set of records using DFSORT

Postby radhika_engimuri » Wed Nov 11, 2009 3:53 pm

Hi

I need help in sorting out below input

My Input data looks like

001Haaaa3 --- H in 4th postion is for header
002Daaaa ---- D in 4th position is for detail
003Daaaa
004Hbbbb1
005Dbbbb
006Dbbbb
007Hcccc3
008Dcccc
009Dcccc
010Heeee1
011Deeee
012Deeee


My output should have set of records which has '3' in postion 9

Ex:
001Haaaa3
002Daaaa
003Daaaa
007Hcccc3
008Dcccc
009Dcccc

Thanks in advance,
Radhika
radhika_engimuri
 
Posts: 7
Joined: Thu Jan 08, 2009 6:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to separate set of records using DFSORT

Postby Frank Yaeger » Wed Nov 11, 2009 11:13 pm

You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
001Haaaa3
002Daaaa
003Daaaa
004Hbbbb1
005Dbbbb
006Dbbbb
007Hcccc3
008Dcccc
009Dcccc
010Heeee1
011Deeee
012Deeee
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(4,1,CH,EQ,C'H'),
    PUSH=(81:9,1))
  OUTFIL INCLUDE=(81,1,CH,EQ,C'3'),BUILD=(1,80)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post