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
 

 

Counting the number of records while sorting.

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

New User


Joined: 07 Mar 2006
Posts: 9
Location: Hyderabad

PostPosted: Sat Dec 09, 2006 11:09 pm    Post subject: Counting the number of records while sorting.
Reply with quote

Its all about sort cards.

See I have a file for eg,

route1 tvm
route2 ekm
route3 thr
route5 knr
route1 abc
route2 def
route3 ghi
route5 hij

I'm going to sort this based on route code:

ie the o/p will look like:

route1 abc
route1 tvm
route2 def
route2 ekm etc........

While sorting i need to get the count of records that comes under a particular route.ie,my purpose is to get the o/p like:

route count

route1 2
route2 2 etc......

Is this possible using a single sort card?I have heard of teh optio of using Count in sort cards.Not sure abt teh syntax.Have u used any time.Need a reply at the earliest.
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: Sun Dec 10, 2006 6:15 am    Post subject:
Reply with quote

This belongs in the DFSORT or JCL Forum, not in the Suggestions and Feedback Forum.

Here are a couple of ways to do this with DFSORT. Either one can be changed to format the output differently. If you need help doing that, tell me exactly what you want the output to look like.

Method 1: ICETOOL OCCUR

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//RPT DD DSN=...  output file
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) BLANK -
  HEADER('route') ON(1,6,CH) -
  HEADER('count') ON(VALCNT,U05)
/*


Method 2: SECTIONS

Code:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  SORT FIELDS=(1,6,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(1,6,
      TRAILER3=(1,6,X,COUNT=(M10,LENGTH=5)))
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
Preetha Ramkumar

New User


Joined: 07 Mar 2006
Posts: 9
Location: Hyderabad

PostPosted: Sun Dec 10, 2006 10:31 pm    Post subject:
Reply with quote

Hi Frank,

Thanks a lot for the detailed solution.I need to try this and revert if I face any problems.Also,thanks for the link on DFSORT icon_smile.gif .

Regards,
Preetha
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 what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts GDG version number PANDU1 JCL & VSAM 4 Sat Mar 04, 2017 8:28 pm


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