HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
Hello experts,
infile:
13.5
2.5
27.5
1.3
5
how can i do sum of above data using ICETOOL
for numeric, I am using STATS FROM INFILE ON(stpos,leng,UFF)
but for decimal numbers, could any one tell me whats the formate code to use? |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Happysrinu,
It gets a little tricky if you have records with both decimal data and without decimal data. In that case we need to modify the records a little bit to get the right total
I assumed that your input file is FB recfm with 80 bytes LRECL and the max length of your numeric data is 10 bytes
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
13.5
2.5
27.5
1.3
5
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,10,SS,NE,C'.'),
OVERLAY=(81:1,8,JFY=(SHIFT=RIGHT),C'.0')),
IFTHEN=(WHEN=NONE,OVERLAY=(81:1,10))
OUTFIL REMOVECC,NODETAIL,BUILD=(80X),
TRAILER1=('TOTAL : ',TOT=(81,10,UFF,EDIT=(TTTTTTTT.T)))
/* |
The output from this
Hope this helps...
Cheers |
|