vijayprabu
New User
Joined: 15 Dec 2005 Posts: 21
|
|
|
|
I have million of records with duplicate of circuit ids. I don't have any unique key also.
I want to get the total of charge amount from all input. The output should display only only line of total amount.
Example :
Charge amount Field
CHARGE-AMT PIC S9(07)V99 COMP-3
Input file
LX775-CIRCUIT-ID | IND LX775-CHARGE-AMT
C(14) (18-31) | PS(7,2) (70-74)
---------------- | --- ----------------
CEOWB LFO 0001, | ,+0.00 ,
CEOWB LFO 0001, | ,+0.00 ,
CEOWB 3BR 0001, | ,+0.00 ,
CEOWB 3BR 0001, | ,+127.00 ,
CEPFC T0Z 0001, | ,+0.00 ,
CEPFC T0Z 0001, | ,+663.36 ,
CEPFC U6E 0001, | ,+0.00 ,
CEPFC U6E 0001, | ,+663.00 ,
CEPFC X7N 0001, | ,+0.00 ,
CEPFC X7N 0001, | ,+691.00 ,
CEPFC X9T 0001, | ,+0.00 ,
CEPFC X9T 0001, | ,+691.00 ,
Output
Total : 2835.36 |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('Total :',TOT=(70,5,PD,EDIT=(IIIIIIIT.TT)))
/*
|
|
|