Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
using syncsort to sum amounts within on line

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Wed Jul 30, 2008 3:26 pm    Post subject: using syncsort to sum amounts within on line
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    Post subject:
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    Post subject: Reply to: using syncsort to sum amounts within on line
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: 757
Location: Germany

PostPosted: Wed Jul 30, 2008 4:12 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us