Help required in getting the count of records in a file



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

Help required in getting the count of records in a file

Postby Shruthi » Tue Jan 18, 2011 5:59 pm

I have a file which has the records as shown below.
Input file:

DABA FI
DABA DK
DABA FI
DABA DK
DABA FI
DABA SE

The output file should be:

DABA DK 2
DABA FI 3
DABA SE 1

can i do this using DFSORT?
Shruthi
 
Posts: 4
Joined: Tue Jan 18, 2011 5:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help required in getting the count of records in a file

Postby skolusu » Tue Jan 18, 2011 11:47 pm

shruthi,

Use the following DFSORT JCL

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
----+----1----+----2----+----3----+----4----+----5----+----6
DABA FI                                                     
DABA DK                                                     
DABA FI                                                     
DABA DK                                                     
DABA FI                                                     
DABA SE                                                     
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  SORT FIELDS=(1,7,CH,A)                                   
  OUTFIL REMOVECC,NODETAIL,                                 
  SECTIONS=(1,7,TRAILER3=(1,7,X,COUNT=(M10,LENGTH=2)))     
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Help required in getting the count of records in a file

Postby Frank Yaeger » Wed Jan 19, 2011 12:15 am

Shruthi,

Alternatively, you can use a DFSORT/ICETOOL job like the following to do this:

//S1    EXEC  PGM=ICETOOL                                         
//TOOLMSG DD SYSOUT=*                                             
//DFSMSG  DD SYSOUT=*                                             
//IN DD *                                                         
DABA FI                                                           
DABA DK                                                           
DABA FI                                                           
DABA DK                                                           
DABA FI                                                           
DABA SE                                                           
//RPT DD SYSOUT=*                                                 
//TOOLIN   DD   *                                                 
OCCUR FROM(IN) LIST(RPT) ON(1,7,CH) ON(VALCNT,U02) NOHEADER       
/*                                                                 


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
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

Re: Help required in getting the count of records in a file

Postby Shruthi » Wed Jan 19, 2011 4:01 pm

Thanks to Skolusu,Frank...
Frank your documents are fantastic...it was really helpful..thank you...
Shruthi
 
Posts: 4
Joined: Tue Jan 18, 2011 5:21 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post