View previous topic :: View next topic
|
Author |
Message |
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Hi Frank/Kolusu,
Can you please help
File 1 (VB file of 4504 length key positions are 18 to 10, 31 to 10 and 44 to 10)
Code: |
XXXXXXXXXXXXXXXXX1234567890XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567890XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567890X
XXXXXXXXXXXXXXXXX1234567891XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567891XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567891X
XXXXXXXXXXXXXXXXX1234567892XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567892XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567899X
|
Fiel2 (FB file 80 length key position is 1 to 10)
Code: |
1234567890
1234567891
1234567899 |
I need to check for the key of File2 in File1 and get the out put if match is found. if 1234567890 is present in position 18 or 31 or 44 position i need to write file1 record to out put file.
my output shuold be
Code: |
XXXXXXXXXXXXXXXXX1234567890XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567890XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567890X
XXXXXXXXXXXXXXXXX1234567891XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567891XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567891X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567899X
|
can you pelase help |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
What is the maximum number of records you can have in file2?
Quote: |
VB file of 4504 length key positions are 18 to 10, 31 to 10 and 44 to 10 |
For these positions, are you counting the RDW in positions 1-4 or are the positions actually 22, 35 and 48? |
|
Back to top |
|
|
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Frank,
Quote: |
What is the maximum number of records you can have in file2? |
There is no such max number, it may be 1lakh
Quote: |
For these positions, are you counting the RDW in positions 1-4 or are the positions actually 22, 35 and 48? |
Yes, i have not added RDW, if we add RDW the actual position is 22,35,48 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
We can't think of a practical way to do this with DFSORT. |
|
Back to top |
|
|
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Frank,
Thanks a lot, i will check for the program then. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Quote: |
Quote:
What is the maximum number of records you can have in file2?
There is no such max number, it may be 1lakh
|
What is the maximum number of records you can have in file1?
Is there any way of recognizing which of the three positions in a record from file 1 that the key to match to file 2 will be found?
One more question, a quick goggle tells me that lakh may mean 100 or 100,000. Which meaning are you using here? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I assumed lakh means 100000, as that's what other people on this board have said it means in the past. If it's actually 100, that's doable. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Hima1985,
Can you clarify that VB file of 4504 length key positions are 18 to 10, 31 to 10 and 44 to 10 are just a single key occurring in those multiple positions? and it is not multiple keys?
i.e
Code: |
XXXXXXXXXXXXXXXXX1234567890XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567890XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1234567890X
|
In the above example, the same key 1234567890 occurs in 3 different positions but on a different record. can you have multiple keys on the same record like this ?
Code: |
XXXXXXXXXXXXXXXXXAAAAAAAAAAXXBBBBBBBBBBXXXXCCCCCCCCCCX
|
These are 3 different keys(aaa,bbb,ccc) embedded in the same record. This one will be tough to achieve. If your input is the way you showed then there is a way to get the desired results.
Douglas Wilder,
1 Lakh = 100,000 |
|
Back to top |
|
|
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Skolusu,
Multiple keys on the same record might be there.
Actually i achieved this by sorting the file at 18th postion first get file1 then on 31 and get file2, then on 44 and get file3. then merge these 3 at last. |
|
Back to top |
|
|
|