special characters handling

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
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

special characters handling

Post by dodda »

Hello

I have an issue while processing data from a file. Iam using seq file stage as source and i need to produce fixed width file so i am using seq file stage as target too.The file is fixed width (310 byte size) and i have file layout which specifies each and every field length. While i was trying to process the file using the seq file stage i encountered some East european data which has special character é in one record which altered the record length to 311 bytes beacuse of which my job failed as i am doing some string to time stamp conversion on one of the field. In datastage admin the parallel locale has been set as UTF-8 and stage NLS-Map is Project Default (UTF-8). I tried with ISO-8859-1 also. We can expect such type of characters in future. I even tried by specifying unicode under the extended properties in the columns tab of the sequential file which i am using to read the input file.

Am i missing some thing. Please assit me in how to handle these type of special characters.
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

can any one help me on this

Regards
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If they can they will post. Be patient. Many folks are on vacation at present.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nikhilanshuman
Participant
Posts: 58
Joined: Tue Nov 17, 2009 3:38 am

Re: special characters handling

Post by nikhilanshuman »

If these special characters do not contain any useful data,you can trim/convert them.

Try using convert("é","",inputlinkname.columnname)

Second option :

use left and ALNUM function.

Step 1: Use function Alnum(inputlinkname.columnname).This function returns 1 if the value contains characters which are not alphnumeric(i.e. if any special character is there).

Step2: If output of step1 is "1"the do following :

left(inputlinkname.columnname,len(inputlinkname.columnname)-2)

Here the above function will take all the characters from left except the last two characters.

Hence,the complete derivation will be :

if Alnum(inputlinkname.columnname)=1 then left(inputlinkname.columnname,len(inputlinkname.columnname)-2)
else inputlinkname.columnname
Nikhil
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

hi,

give a try by taking datatype as Nvarchar without defining length.Hope it will work
thanks n regards
nani
Post Reply