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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am

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