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: 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 CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm


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