IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Count of records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suraaj

New User


Joined: 16 Apr 2009
Posts: 69
Location: Canada

PostPosted: Tue Apr 30, 2013 2:13 am
Reply with quote

Input file key is as below:

0101011000000000000001
0101021000000000000002
0101031000000000000003
0101041000000000000004
0101051000000000000005
0101061000000000000006
0102011000000000000007
0102021000000000000008
0102031000000000000009
0102041000000000000010
0102051000000000000011
0102061000000000000012

The first six characters can repeat as many times as they want but the next 16 characters being unique.

I need to get count of records which have

0101 at third - sixth position,
0102 at third - sixth position,
0103 at third - sixth position,
0104 at third - sixth position,
0105 at third - sixth position,
0106 at third - sixth position,
0201 at third - sixth position
-----
so on till
9906 at third - sixth position

Do let me know for further details...

Please help...
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Apr 30, 2013 3:32 am
Reply with quote

suraaj,

use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
0101011000000000000001                                         
0101021000000000000002                                         
0101031000000000000003                                         
0101041000000000000004                                         
0101051000000000000005                                         
0101061000000000000006                                         
0102011000000000000007                                         
0102021000000000000008                                         
0102031000000000000009                                         
0102041000000000000010                                         
0102051000000000000011                                         
0102061000000000000012                                         
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  INREC BUILD=(3,4)                                           
  SORT FIELDS=(1,4,CH,A)                                       
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                       
  SECTIONS=(1,4,                                               
  TRAILER3=('COUNT OF ',1,4,' AT THIRD - SIXTH POSITION IS ', 
            COUNT=(M10,LENGTH=8)))                             
//*
Back to top
View user's profile Send private message
Suraj.Nair

New User


Joined: 07 Jun 2011
Posts: 17
Location: Canada

PostPosted: Tue Apr 30, 2013 7:47 pm
Reply with quote

Thanks Kolusu for the solution!!! Appreciate it!!!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top