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 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: 183
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 1 Wed Dec 06, 2017 1:50 am
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

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