Page 1 of 1

Edit pattern Mask in SUM fields

PostPosted: Fri Jan 27, 2012 1:16 pm
by fornanthakumar
Hi,

I need to sum up based on certain numeric fields and i just want to change the pattern of display using mask

Input;

12341000
12342050
12341040
12351000
12355050

output:
123440.90
123560.50

My SORT card is,

SORT FIELDS=(1,4,CH,A)
SUM FIELDS=(5,4,ZD) but when i tried
SUM FIELDS=(5,4,ZD,M14) -> IT says syntax error. i have even tried SUM FIELDS=(5,4,ZD,EDIT=(TT.TT))
Please help me out..

Re: Edit pattern Mask in SUM fields

PostPosted: Fri Jan 27, 2012 5:13 pm
by NicC
Are either of those options for SUM recorded in the manual? You cannot just make up syntax.

Re: Edit pattern Mask in SUM fields

PostPosted: Fri Jan 27, 2012 9:57 pm
by skolusu
fornanthakumar,

You cannot reformat the summed fields on the SUM Fields statement. You need to use OUTREC or Reporting features to edit mask your summed field. Use the following DFSORT JCL which will give you the desired results.
//STEP0100 EXEC PGM=SORT                 
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD *                           
12341000                                 
12342050                                 
12341040                                 
12351000                                 
12355050                                 
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                           
  SORT FIELDS=(1,4,CH,A)                 
  SUM FIELDS=(5,4,ZD)                     
  OUTREC OVERLAY=(5:5,4,ZD,EDIT=(TT.TT)) 
//*