Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

count the number of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
bcmohanty

New User


Joined: 17 May 2006
Posts: 17

PostPosted: Thu Jun 29, 2006 12:21 pm    Post subject: count the number of records
Reply with quote

plese let me know how to count the number of records using sort
requirement
i have 46 state codes
first i need to sort them (Done)
then counts the number of records for particular coads.....
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jun 29, 2006 8:54 pm    Post subject:
Reply with quote

Please show an example of your input records and what you want for output. What is the RECFM and LRECL of the input file? What is the starting position, length and format of the state code field?
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Fri Jun 30, 2006 12:11 pm    Post subject:
Reply with quote

Hi,
Here is the solution with few assumptions.

1)State code is of length 2 starting at position 9.
2)Sortting is done on the state code.
4)Total number of records were displayed with the total record on state code basis.

Code:


//PS020    EXEC PGM=ICETOOL                                 
----+----1----+----2----+----3----+----4----+----5----+----6-
//SYSOUT   DD  SYSOUT=*                                     
//TOOLMSG  DD  SYSOUT=*                                     
//DFSMSG   DD  SYSOUT=*                                     
//IN1      DD  *                                             
12345   AP                                                   
23456   AP                                                   
21345   TN                                                   
213456  TN                                                   
212121  TN                                                   
213456  HR                                                   
212121  HR                                                   
//OUT1     DD  SYSOUT=*                                     
//TOOLIN   DD  *                                             
   SORT FROM(IN1) TO(OUT1) USING(CTL1)                       
//CTL1CNTL DD  *                                             
   INREC FIELDS=(1,10,C'00000001')                           
   SORT FIELDS=(9,2,CH,A)                                   
   SUM FIELDS=(11,8,ZD)                                     
   OUTREC FIELDS=(1,10,11,8,ZD,M10,66X)                     
/*                                                           



The o/p will look like

Code:


12345   AP       2
213456  HR       2
21345   TN       3



Thank you
Krishy
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jun 30, 2006 8:34 pm    Post subject:
Reply with quote

That particular requirement can be done more easily with DFSORT/ICETOOL's OCCUR operator. For example:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//RPT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) BLANK -
  HEADER('State') ON(9,2,CH) -
  HEADER('Count') ON(VALCNT,U05)
/*


RPT will have:

Code:

State    Count     
-----   ------     
AP           2     
HR           2     
TN           3     


Of course, the report can be tailored appropriately using various OCCUR options as described at:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/6.9?DT=20050222160456
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us