Icetool count indexes



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Icetool count indexes

Postby Florian Sorg » Tue Jan 24, 2012 8:55 pm

Hi,
excuse me if my english isn't very well, i'm from germany ;-)

I've a question about the count funktion of DFSORT/ICETOOl

for example i have a table:

a | 5 | 7
b | 7 | 3
c | 3 | 6

and i want to count vertically that it locks like:

all | 15 | 16

is this possible?

Thanks for answering
Flo
Florian Sorg
 
Posts: 3
Joined: Tue Jan 24, 2012 7:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Icetool count indexes

Postby BillyBoyo » Tue Jan 24, 2012 9:12 pm

Yes, it is possible.

If you can give some thought to whether this is a complete description of what you want, like you want only one line on a report? One record in a file? Last line of a report? Final record on a file, etc?

Describe it as best you can, and then when you wake up tommorow you'll probably have an enlightening and extremely pleasant surprise.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Icetool count indexes

Postby Florian Sorg » Tue Jan 24, 2012 9:59 pm

ok the numbers in the table are indexes and i have to count vertically and write a line unter the table
e.g:
input:
a |5 | 7
b |7 | 3
c |3 | 6

output:
a |5 | 7
b |7 | 3
c |3 | 6
all |15|16

i had tried it like this:
//TOOLIN DD *
SORT FROM(DATA) TO(DATA2) USING(CNT1)
/*
//CNT1CNTL DD *
SORT FIELDS=(1,4,CH,A)
SUM FIELDS=(6,2,ZD,9,2,ZD)
/*
But it doesn't work :-(

thanks a lot
Florian Sorg
 
Posts: 3
Joined: Tue Jan 24, 2012 7:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Icetool count indexes

Postby Frank Yaeger » Tue Jan 24, 2012 11:47 pm

You can use a DFSORT job like the following to do what you asked for:

//S1 EXEC PGM=SORT                                         
//SYSOUT DD SYSOUT=*                                       
//SORTIN DD *                                               
a   |5 | 7                                                 
b   |7 | 3                                                 
c   |3 | 6                                                 
//SORTOUT DD SYSOUT=*                                       
//SYSIN DD *                                               
  OPTION COPY                                               
  OUTFIL REMOVECC,                                         
    TRAILER1=('all |',TOT=(6,2,UFF,M10,LENGTH=2),'|',       
     TOT=(9,2,UFF,M10,LENGTH=2))                           
/*


Note that we use the TOT function for the totals, not the COUNT function.

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:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Icetool count indexes

Postby Florian Sorg » Wed Jan 25, 2012 2:37 pm

the code is working,
thanks for the quick answering thats realy great
Florian Sorg
 
Posts: 3
Joined: Tue Jan 24, 2012 7:21 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post