Need help for Summing fields using SORT



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Need help for Summing fields using SORT

Postby sharabu07 » Mon Dec 20, 2010 12:05 am

Hi,
I have a flat file with four columns with below description

ABC -001 +002 +003
DEF +001 -002 +003
GHI -001 +002 +003

Now i want the sum of col2, col3, col4 in the output file as mentioned below

-001 002 009

also these columns in input file are in packed decimal format so before adding these i need to convert it into ZD format to make them displayable in output file.

Can anyone please help with the syntax of sort card that can be used to suffice the above requirment ?
sharabu07
 
Posts: 1
Joined: Sun Dec 19, 2010 11:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help for Summing fields using SORT

Postby dick scherrer » Mon Dec 20, 2010 3:02 am

Hello and welcome to the forum,

Which sort product and release are used on the system?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Need help for Summing fields using SORT

Postby Frank Yaeger » Mon Dec 20, 2010 10:16 pm

What is the RECFM and LRECL of the input file?

What is the starting position and length of the key field and each PD field.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post