help needed with hash file with key combinations
Posted: Mon Jul 04, 2005 8:02 pm
Hi,
I need help with below problem I am getting,
All data in file is in sorted in order on 4 columns (S_NO, VC_NO, CITY, DATE ),
I am trying to pull first record from combination of three keys (S_NO, VC_NO, CITY), when I try to use hash file stage it is pulling correct key combination but not the first record I need, let me give a example,
Example:
INPUT RECORDS:
S_NO | VC_NO | CITY| DATE|
1001 | X1002 | CITY1 | 2005/04/22
1001 | X1002 | CITY1 | 2001/05/01
1002 | X2002 | CITY2 | 2005/06/21
1003 | X3002 | CITY3 | 2005/04/22
1003 | X3002 | CITY3 | 2004/01/05
OUT RECORDS:
S_NO | VC_NO | CITY| DATE|
1002 | X2002 | CITY2 | 2005/06/21
1001 | X1002 | CITY1 | 2001/05/01
1003 | X3002 | CITY3 | 2005/04/22
This is what I am getting when I use hash stage with key combination of (S_NO, VC_NO, CITY)
What I need in output file is:
S_NO | VC_NO | CITY| DATE|
1001 | X1002 | CITY1 | 2005/04/22
1002 | X2002 | CITY2 | 2005/06/21
1003 | X3002 | CITY3 | 2005/04/22
Thank you,
Ashok
I need help with below problem I am getting,
All data in file is in sorted in order on 4 columns (S_NO, VC_NO, CITY, DATE ),
I am trying to pull first record from combination of three keys (S_NO, VC_NO, CITY), when I try to use hash file stage it is pulling correct key combination but not the first record I need, let me give a example,
Example:
INPUT RECORDS:
S_NO | VC_NO | CITY| DATE|
1001 | X1002 | CITY1 | 2005/04/22
1001 | X1002 | CITY1 | 2001/05/01
1002 | X2002 | CITY2 | 2005/06/21
1003 | X3002 | CITY3 | 2005/04/22
1003 | X3002 | CITY3 | 2004/01/05
OUT RECORDS:
S_NO | VC_NO | CITY| DATE|
1002 | X2002 | CITY2 | 2005/06/21
1001 | X1002 | CITY1 | 2001/05/01
1003 | X3002 | CITY3 | 2005/04/22
This is what I am getting when I use hash stage with key combination of (S_NO, VC_NO, CITY)
What I need in output file is:
S_NO | VC_NO | CITY| DATE|
1001 | X1002 | CITY1 | 2005/04/22
1002 | X2002 | CITY2 | 2005/06/21
1003 | X3002 | CITY3 | 2005/04/22
Thank you,
Ashok