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
 

 

How to SUM the values using syncsort

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

New User


Joined: 02 Feb 2010
Posts: 14
Location: hyderabad

PostPosted: Thu Jul 07, 2011 11:44 am    Post subject: How to SUM the values using syncsort
Reply with quote

I would like to add a field based on two fileds in syncsort. Please find the below example:
A B C D
------- --- ----------------- ------
M0001 1 SWITCHING CA 19999
M0001 1 SWITCHING CA 19999

In this example I want to sum the coluomn B based on Column A & Coloumn D. If A & D matches then ADD B. Please suggest how to write this using syncsort.

Thanks,
Rajesh.
Back to top
View user's profile Send private message

prasanth_thavva

New User


Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Thu Jul 07, 2011 11:50 am    Post subject: Reply to: How to SUM the values using syncsort
Reply with quote

Can you post the field length and also post your control which you are trying to acheive the result.

On response to this, pls post and input and out put expected results.
that will help us to fine tune ur control card.
Back to top
View user's profile Send private message
elijarajesh.mf
Warnings : 1

New User


Joined: 02 Feb 2010
Posts: 14
Location: hyderabad

PostPosted: Thu Jul 07, 2011 11:59 am    Post subject:
Reply with quote

After sorting I want to get the record like this:


Input:

A B C D
------- --- ----------------- ------
M0001 1 SWITCHING CA 19999
M0001 1 SWITCHING CA 19999


Expected output:

A B C D
------- --- ----------------- ------
M0001 2 SWITCHING CA 19999 --------> In Column B values is 2 now with single record.

Lengths:
Coloumn A -----> 5 BYTES
Coloumn B -----> 3 BYTES
Coloumn C -----> 13 BYTES
Coloumn D -----> 5 BYTES.

Thanjs,
Raj
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Jul 07, 2011 12:07 pm    Post subject: Reply to: How to SUM the values using syncsort
Reply with quote

If you use the CODE tag when you submit your post, it will keep all your formatting.

When posting, highlight the text for your example data and click on Code button, around about the middle and above the input box.

This is Syncsort, so off to the JCL forum soon, I'd guess.
Back to top
View user's profile Send private message
prasanth_thavva

New User


Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Thu Jul 07, 2011 12:14 pm    Post subject: Reply to: How to SUM the values using syncsort
Reply with quote

Post ur Control card that are currently working on to acheive the result
this can be acheived using sort and sum fields
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jul 07, 2011 12:32 pm    Post subject:
Reply with quote

assume you will never have more than 999 of the same key.
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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


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