Page 1 of 1

Add Numeric Values Using JCL

Posted: Fri Apr 08, 2016 7:39 pm
by venky
Hi All,

Can anyone please look into the below question.

I have a 80 byte file with the below records.

164 NUMS:000001
123 NUMS:000001
122 NUMS:000001
223 NUMS:000001
444 NUMS:000001

Need output as below.


164 NUMS:000001
123 NUMS:000001
122 NUMS:000001
223 NUMS:000001
444 NUMS:000001
SUM :000005

When I am trying to use as below

SORT FIELDS=(005,04,CH,A),EQUALS
SUM FIELDS=(10,6,ZD)

but i am getting the output as.

164 NUMS:000005

Thank you.

Posted: Sat Apr 09, 2016 12:32 pm
by William Collins
Why do you want to SORT the data which is already in the order you want?

Look at OUTFIL reporting features: REMOVECC, SECTIONS with TRAILER3 using TOT/TOTAL. You can format the data in many ways like that.

As well as sucking-up resources and consolidating data, SUM has no options for formatting.