IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Only total of charge amount in OUTPUT by using SORT?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vijayprabu

New User


Joined: 15 Dec 2005
Posts: 21

PostPosted: Thu Nov 05, 2009 2:46 am
Reply with quote

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
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Nov 05, 2009 2:57 am
Reply with quote

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)))
/*
Back to top
View user's profile Send private message
vijayprabu

New User


Joined: 15 Dec 2005
Posts: 21

PostPosted: Thu Nov 05, 2009 3:19 am
Reply with quote

Thanks lot! I appreciate you help. My code is working now.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top