Hi,
Can you please let me know how to use the HASH function / HASH algoritham in DataStage
Parallel?
Requirement: Pass 10 digit string to the function and the function will generate the
UNIQUE number based on the input string.
Example :
Input Data Expected Output
ABCD 1512
PQRS 7894
ABCD 1512
QWER 4597
The output number should be four digit number ALWAYS.
Number of input rows are less than 9999.
If not HASH is there any another method to suffies this requirement.
I appreciate your help.
thanks and regards
bob
HASH Function?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Your target field has 10000 possible unique combinations, your source field has 531441 unique combinations. There is no way you can turn four alphas with 27 possible values each into 4 numbers with 10 possible values each without losing uniqueness. You could generate a surrogate key using the surrogate key stage so that any new input data gets the next surrogate key value in the list. This will work until you hit surrogate key number 9999.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn