View previous topic :: View next topic
|
Author |
Message |
yoelb
New User
Joined: 26 Apr 2007 Posts: 4 Location: Israel
|
|
|
|
I have two input files: one with a list of IDs and another with transactions records, which the ID is included in each transaction record in a specific place.
I want to create one sorted output with all the fields from the transaction file.
In this output, I want to mark the records which match the ID in the IDs list file by changing the value of one of their fields.
Can this be done with syncsort? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post sample data from both input files and what the output from those sample inputs should contain.
When you post the 3 files, please use the "Code" tab at the top of the reply [anel. |
|
Back to top |
|
|
yoelb
New User
Joined: 26 Apr 2007 Posts: 4 Location: Israel
|
|
|
|
IDs list (input):
Transactions list (input):
Code: |
10,OK
11,OK
12,OK
13,OK
14,OK
|
Output file (for all matching IDs - the "OK" should be replaced with "REJECT") :
Code: |
10,OK
11,REJECT
12,REJECT
13,REJECT
14,OK
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Your initial post asks about "both condition and join" in one run (if i understood correctly).
From the sample data posted, i'm not sure where "condition" might apply. Please clarify.
This requirement would easily be met with a small COBOL program.
So far, i'm not sure if Syncsort will do exactly what you've shown as your requirement. I'll look some more. . . |
|
Back to top |
|
|
yoelb
New User
Joined: 26 Apr 2007 Posts: 4 Location: Israel
|
|
|
|
Thanks.
The example I gave describes my problem better than my first message.
I'm looking for a solution in syncsort, to be called via SYSTEM call from a CPP class.
We are dealing with large files so I prefer to perform it in syncsort if possible, rather than in the CPP.
Regards. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
yoelb,
Your examples shows only one occurence of a given key in each file. If this is the case, why dont you concatenate both the IP files (in the order IDs and Transactions file) and remove the duplicates. Before concatenating reformat the IDs file with REJECT string. |
|
Back to top |
|
|
yoelb
New User
Joined: 26 Apr 2007 Posts: 4 Location: Israel
|
|
|
|
Sorry, the example is just to simplify things so it will be more understandable.
The key will occur in many records in the Transactions list.
Also, the key appears somewhere in the middle of the record and not as presented in the example as the first field (again, I wanted to focus on the problem).
Can it be done in syncsort?
Thanks. |
|
Back to top |
|
|
|