Data comparison with Mix Case alphabets

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
saadmirza
Participant
Posts: 76
Joined: Tue Mar 29, 2005 2:57 am

Data comparison with Mix Case alphabets

Post by saadmirza »

Hi,
I have data coming from the source with words having Mix case(e.g MiKe)...I need to compare the word with a hash file lookup that contains a word(e.g MIKE)...with a normal match i am not able to do that...how do i achieve the same using DS.?

Regards,
SM
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The UPCASE() function will convert to uppercase pretty efficiently, do that with both strings and you are in production 8)
saadmirza
Participant
Posts: 76
Joined: Tue Mar 29, 2005 2:57 am

Post by saadmirza »

Yes Arnd,
Thats pretty simple...but the actual requirement is to restore the data with the original mix case characters...

Thanks,
SM
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Could you explain? Your post states you want to do a match with one uppercase string to a mixed case string, the UPCASE() function lets you do that. So you now have the original string , an uppercased string and a true/false result on a match - what more do you need?
talk2shaanc
Charter Member
Charter Member
Posts: 199
Joined: Tue Jan 18, 2005 2:50 am
Location: India

Post by talk2shaanc »

In short,
for comparison have UPCASE(Src.Name)=UPCASE(Lkp.NAME), but while writing the field, dont do any transformation, simple one to one mapping(do not change case)
Shantanu Choudhary
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

You can use the UpCase function in the Key Expression of the hash lookup for the comparison, but not UpCase the field as it goes to your target.

Hope this helps.

John
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can pass your source link value to the target to retain mixed case.
saadmirza
Participant
Posts: 76
Joined: Tue Mar 29, 2005 2:57 am

Post by saadmirza »

Yes I can do an Upcase in the Hashfile Key Expression column...but what about my source file...for e.g in hash file I have "John" and the source file I have "JOHn" as input...how do I compare using hash file compare?

Please suggest.

Thanks,
SM
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Make the acutal key to your Hash file an uppercase name, create a temporary column in your job with the uppercase lookup name and use that as the lookup key to your hash file.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Or simply use UpCase function in the link to reference.
Post Reply