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

using syncsort to sum amounts within on line


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Jul 30, 2008 3:26 pm
Reply with quote

Hi !

Is there a possibility to sum several amounts in one line and add the total ammount to that line by using syncsort.

Example: build total of columns 1,3,5 and 2,4,6
Would be: 99 and 132
Add this to the line

InputFile: 11 22 33 44 55 66 77 88

OutputFile: 11 22 33 44 55 66 77 88 - 99 132

I also post this question in DFSORT-Section, cause i work on several plattforms using Syncsort and Ddfsort. So it's beneficial to have both solutions.

Thank's in advance !
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 30, 2008 3:45 pm
Reply with quote

check this
Code:
//*******************************************************       
//STEP1    EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
11 22 33 44 55 66 77 88                                         
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  INREC OVERLAY=(30:(1,2,ZD,ADD,7,2,ZD,ADD,13,2,ZD),EDIT=(TTT),
                 40:(4,2,ZD,ADD,10,2,ZD,ADD,16,2,ZD),EDIT=(TTT))
/*                                                             
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Jul 30, 2008 3:45 pm
Reply with quote

Hi,

The following program will suits ur need.

Code:

//JSTP0010 EXEC PGM=SYNCSORT                                       
//SORTIN   DD  DSN=DEV2.RK.TEST(@@CASE1),                     
//             DISP=SHR                                       
//SORTOUT  DD  DSN=DEV2.RK.TEST(@@CASE2),                     
//             DISP=SHR                                       
//SYSOUT   DD SYSOUT=*                                         
//SYSUDUMP DD SYSOUT=*                                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  OUTREC OVERLAY=(25:1,2,ZD,ADD,7,2,ZD,ADD,13,2,ZD,LENGTH=4,   
                  30:4,2,ZD,ADD,10,2,ZD,ADD,16,2,ZD,LENGTH=4) 
/*                                                             
//*                                                           


Input:

Code:

11 22 33 44 55 66 77 88     


Output:

Code:

11 22 33 44 55 66 77 88  99  132 


Regards
R KARTHIK
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Jul 30, 2008 4:12 pm
Reply with quote

Thank's, that's really what i need !
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top