How to sum decimal number using sort



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

How to sum decimal number using sort

Postby prabu_krish » Mon Nov 21, 2011 7:36 pm

Hi All,
i am facing s0c7 issue while summing on decimal fields(eg.0000000004.5).input/output record length of the file is 52.

SORT CARD:
SORT FIELDS=(1,40,CH,A)
SUM FIELDS=(41,12,ZD)

INPUT RECORD:
00313122700000687800000000100020000128140000000004.0
00313122700000687800000000100020000128140000000004.5
00313122700000687800000000100020000128140000000004.5
00313122700000687800000000100020000128140000000004.0


Hope its clear, Thanks for your help.
prabu_krish
 
Posts: 7
Joined: Tue May 24, 2011 12:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to sum decimal number using sort

 

Re: How to sum decimal number using sort

Postby skolusu » Mon Nov 21, 2011 9:52 pm

prabu_krish,

You need to use the UFF format to sum data with explicit decimal point.

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
----+----1----+----2----+----3----+----4----+----5----+
00313122700000687800000000100020000128140000000004.0   
00313122700000687800000000100020000128140000000004.5   
00313122700000687800000000100020000128140000000004.5   
00313122700000687800000000100020000128140000000004.0   
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
  SORT FIELDS=(1,40,CH,A),EQUALS                       
  OUTFIL REMOVECC,NODETAIL,                           
  SECTIONS=(1,40,                                     
  TRAILER3=(1,40,TOT=(41,12,UFF,EDIT=(TTTTTTTTTT.T))))
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: How to sum decimal number using sort

Postby prabu_krish » Tue Nov 22, 2011 2:52 pm

Hi skolusu,

Thanks a lot, its working fine. To understand better, can you provide a link which describe the above sort fields?

Thanks
prabu_krish
 
Posts: 7
Joined: Tue May 24, 2011 12:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to sum decimal number using sort

Postby BillyBoyo » Tue Nov 22, 2011 2:58 pm

Have a look at Kolusu's "sig" at the bottom of his post.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to sum decimal number using sort

Postby skolusu » Tue Nov 22, 2011 10:51 pm

prabu_krish,

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
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: How to sum decimal number using sort

Postby prabu_krish » Wed Nov 23, 2011 1:37 pm

Hi skolusu,

thanks again!! :)
prabu_krish
 
Posts: 7
Joined: Tue May 24, 2011 12:10 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post