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

Addition of value in each record using DFSORT


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

New User


Joined: 09 Sep 2007
Posts: 10
Location: Chennai

PostPosted: Fri Feb 01, 2008 8:01 pm
Reply with quote

Hi,
I have a requirement where I have to add the values of each record in a file and write the total to a different file.
For Ex.
I/P File:
123-->each line is different record in the same file.
234
111
222
O/P File:
690.
Is it possible to do the above arithmetic opeartion using sort.

Thanks
Baskaran Gunasekaran.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Feb 01, 2008 8:29 pm
Reply with quote

Code:
//*******************************************
//S1       EXEC  PGM=ICEMAN                 
//SYSOUT   DD  SYSOUT=*                     
//SORTIN   DD *                             
123                                         
234                                         
111                                         
222                                         
/*                                           
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD    *                           
  SORT FIELDS=COPY                           
  OUTFIL REMOVECC,NODETAIL,                 
      TRAILER1=(1:TOT=(1,3,ZD,M11,LENGTH=3))
/*                                           
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top