Double-byte to Single-byte string/character conversion

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
naveed.zuber
Participant
Posts: 19
Joined: Wed Jul 16, 2014 4:14 am

Double-byte to Single-byte string/character conversion

Post by naveed.zuber »

Please suggest a way to convert double-byte string to single byte string in DataStage.
This conversion is required to match the data with the existing data in DB2

Ex:
BMW(Double byte string) to BMW(Signle byte string)

Source is CSV file
DataStage version 8.7
DB2
Unix

Please let us know in case of any questions.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

you can try using convert function to replace these characters to ASCII. You will have to identify all such characters and put it in convert function.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Note that the majority of double-byte characters cannot be mapped to single-byte. There are just too many of the former.

If you are certain that all of the characters from source can be validly mapped then, yes, it is possible to do so.

Probably the easiest method is to specify Unicode extended property on the link connecting to source, then use a string_from_ustring() mapping in a Modify stage (or UstringToString() function in a Transformer stage).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply