View previous topic :: View next topic
|
Author |
Message |
bmanoj1
New User
Joined: 19 Aug 2005 Posts: 4 Location: Hyderabad
|
|
|
|
Hi!
I am having a requirement comparing two files. 1st file having 10 records and 2nd file having one record with one field only. In both the files date field is the key(date-1 in first file and date-2 in 2nd file). I want to select all the records from the first file for date-1 in file-1 is less than or equals to date-2 in file-2. Can i do this using syncsort.
Regards,
Manoj |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yes.
What have you tried, and what errors are you experiencing.
What does it say in the manual about this.
What similar or same topics did you find with a forum search.
Does google not work where you are |
|
Back to top |
|
|
bmanoj1
New User
Joined: 19 Aug 2005 Posts: 4 Location: Hyderabad
|
|
|
|
Hi Expat,
I have tried with joinkeys but that only works for matched or unmatched records and i can't check "less than or equals to" condition
sample sort code i have tried-
JOINKEYS FILE=F1,FIELDS=(207,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,413,F2:1,8)
OPTION COPY
if i can get the output as "rec-1 from 1st file and the date-2 field from file-2 appended towards the end of file-1 then i can get the required result. The problem is with file-2 having one record.
without joinkeys can i format the data in two files to the format as "rec-1 from file-1 with the date-2 field appended at the end of each record.
here are the sample file formats.
inputs-
file-1 (4 records) file-2 (1 record)
111 2010-06-13 AAA 2010-06-16
112 2010-06-18 BBB
113 2010-06-16 CCC
114 2010-06-19 DDD
output
file-3 (4 records)
111 2010-06-13 AAA 2010-06-16
112 2010-06-18 BBB 2010-06-16
113 2010-06-16 CCC 2010-06-16
114 2010-06-19 DDD 2010-06-16
currently i am looking for the above output file using syncsort, so that it is easier for me to compare and get the final output. |
|
Back to top |
|
|
bmanoj1
New User
Joined: 19 Aug 2005 Posts: 4 Location: Hyderabad
|
|
|
|
find the input file layouts to avoid confusion
file-1 (4 records)
111 2010-06-13 AAA
112 2010-06-18 BBB
113 2010-06-16 CCC
114 2010-06-19 DDD
file-2 (1 record)
2010-06-16 |
|
Back to top |
|
|
|