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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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