View previous topic :: View next topic
|
Author |
Message |
bharathrudra
New User
Joined: 31 Mar 2010 Posts: 3 Location: Hyderabad
|
|
|
|
Hi i am having the records in this format:
Input:
HD1
1.....100
1.....150
1.....100
2.....200
2.....300
3.....300
TR1
HD2
4.....100
5.....100
6.....100
TR2
Expected output
HD1
1.....350
1.....150
1.....100
2.....200
2.....300
3.....300
TR1
HD2
4.....100
5.....100
6.....100
TR2
i have to do this using syncsort. Is there any solution? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Is there any solution? |
not until You explain the logic to transform
Code: |
1.....100
1.....150
1.....100 |
into
Code: |
1.....350
1.....150
1.....100 |
|
|
Back to top |
|
|
bharathrudra
New User
Joined: 31 Mar 2010 Posts: 3 Location: Hyderabad
|
|
|
|
summing up the fileds, while summing up we need to take care of the header and trailer as we will be having spaces at the position mentioned in the detail records |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Your explanation would be true for something along ...
Code: |
Input:
HD1
1.....100
1.....150
1.....100
2.....200
2.....300
3.....300
TR1
HD2
4.....100
5.....100
6.....100
TR2
output :
HD1
1.....350
2.....500
3.....300
TR1
HD2
4.....100
5.....100
6.....100
TR2 |
we still need a better explanation ! |
|
Back to top |
|
|
bharathrudra
New User
Joined: 31 Mar 2010 Posts: 3 Location: Hyderabad
|
|
|
|
i hope that was the requirement. What i first gave is the requirement. let me it is possible. If the solution is in two different stpes also that should be fine.
Is joinkeys of any help here? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
i hope that was the requirement |
IT is not based on hopes, but on facts
until You are sure of the requirements and are able to express them clearly
we are just wasting time
also guessing about what <sort> function to use is a bit premature in such a foggy situation |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Unfortunately what you want is only known to yourself and no other.
I have tried to work out the logic for getting from input to output and can see none that works for me.
Please read some other sort topics and see what other information will be asked for before posting.
1) RECFM & LRECL of the input dataset
2) Position, length and format of key fields.
3) Samples of input and output.
4) Logic for getting from input to output.
Unless you post this vital information I am afraid that your search for help ends with your inability to post required data. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Well, I hope you could spot the difference in what Enrico has posted compared to what you post. Enrico showed:
Quote: |
HD1
1.....350
2.....500
3.....300
TR1 |
which looks logical while your first post shows the output as:
Quote: |
HD1
1.....350
1.....150
1.....100
2.....200
2.....300
3.....300
TR1 |
Both the expected outputs are totally different and characters in blue looks un-necessary for the output - but following the Enrico post you say - "i hope that was the requirement" ... |
|
Back to top |
|
|
|