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

Summing numbers in free text format


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

New User


Joined: 17 Aug 2007
Posts: 29
Location: Brussels

PostPosted: Fri Oct 12, 2007 8:12 pm
Reply with quote

Hi all,

Can DFSORT sum fields containing numbers in the following format?

+000000000013,000
-000000000001,713
-000000000059,000

That is, the sign is in front and the decimal part is separated by a ',' (comma).


Thanks.

Julien
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 12, 2007 9:38 pm
Reply with quote

You can use DFSORT's SFF format for those types of numbers. You can get a total for these values with a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
+000000000013,000
-000000000001,713
-000000000059,000
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(TOT=(1,17,SFF,EDIT=(STTTTTTTTTTTT,TTT),SIGNS=(+,-)))
/*


SORTOUT would have:

Code:

-000000000047,713
Back to top
View user's profile Send private message
julienloc

New User


Joined: 17 Aug 2007
Posts: 29
Location: Brussels

PostPosted: Mon Oct 15, 2007 6:40 pm
Reply with quote

This works great.
Thanks for the answer.

Julien
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top