Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
MGIndaco

Moderator


Joined: 10 Mar 2005
Posts: 478
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
References
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4684
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

Moderator


Joined: 10 Mar 2005
Posts: 478
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: 4684
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1