IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

adding floating number with ICEtool


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Tue Sep 09, 2008 6:02 pm
Reply with quote

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?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 09, 2008 9:30 pm
Reply with quote

Hello,

Look in the DFSORT part of the forum for topics that mention UFF and/or SFF (Unsigned and Signed Free Format).
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Sep 09, 2008 10:03 pm
Reply with quote

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

Code:

TOTAL :       49.8 

Hope this helps...

Cheers
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top