Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Count of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Count of records
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    Post subject:
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    Post subject: Reply to: Count of records
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us