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
 

 

DfSort Count multiple fields

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

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Aug 30, 2005 8:53 pm    Post subject: DfSort Count multiple fields
Reply with quote

Hi to all.

I'm looking for a way to write and execute less amout of sortstep I can.

I've searched in this forum for various sample of count but I can't find what I need.

Assume this input layout:
Code:
AAA-0001-BB-F
AAA-0002-CC-F
AAA-0003-CC-F
AAA-0005-DD-F
BBB-0009-AA-F


I need this output:
Code:
AAA 0004
BBB 0001
BB  0001
CC  0002
DD  0001
F   0020 /*this is the sum of the second field */


It's possible execute a list of sum directly thru ICETOOL and generate this output?

All the comment are wellcome
P.S.= LrecL and RecFm are not important.
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: Tue Aug 30, 2005 11:04 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
AAA-0001-BB-F
AAA-0002-CC-F
AAA-0003-CC-F
AAA-0005-DD-F
BBB-0009-AA-F
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,
    OUTREC=(C'1',1,3,6:C'0001'/,
            C'3',13,1,6:5,4,/,
            C'2',10,2,6:C'0001')
//CTL2CNTL DD *
  OPTION ZDPRINT
  SORT FIELDS=(1,4,CH,A)
  SUM FIELDS=(6,4,ZD)
  OUTREC FIELDS=(2,8)
/*


OUT will have:

Code:

AAA 0004
BBB 0001
AA  0001
BB  0001
CC  0002
DD  0001
F   0020
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Aug 30, 2005 11:49 pm    Post subject:
Reply with quote

Hi Frank, really thanks! Your solution is great!
36_8_11.gif
Really congrats to you and your punctual genius.
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: Wed Aug 31, 2005 12:19 am    Post subject:
Reply with quote

Glad I could help. That's a pretty fancy happy face.
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


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