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
 
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 How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am

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