Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Addition of value in each record using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Addition of value in each record using DFSORT
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us