special characters in sequentail file

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
say2prabhu1
Participant
Posts: 27
Joined: Mon Jul 09, 2007 1:06 am

special characters in sequentail file

Post by say2prabhu1 »

While we are loading data into seqential file,it is padding with some special char(may be null).I want to remove the special char from file.I tried with padding option in column(field properties).. still some of the records are padding with null char .. If anyone already handled this problem, help me
Abhinav
Premium Member
Premium Member
Posts: 65
Joined: Tue Jun 29, 2004 10:26 am
Location: California

Re: special characters in sequentail file

Post by Abhinav »

Use environment variable $APT_PAD_CHAR to remove the default pad characters.

Abhi
abhi989
Participant
Posts: 28
Joined: Mon Sep 19, 2005 2:31 pm

Post by abhi989 »

you can use

cat -tv file_name to see if you have null padding. (^@ - if you see this symbol that means you have null padding.) if you do that you can use the following to get rid of that.

Add the transformer between the input_col and the output_col. Set input_col nullable to yes. And output_col nullable to no. put this in the expression editor.

left(trim(input_col, char(000)):space(length_of_the_output_col), length_of_the_output_col)

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

Post by ray.wurlod »

Use environment variable APT_STRING_PADCHAR to specify the padding character.

You are right that is it is, by default, 0x00. You could change it to, say, a space character.

Only CHAR data types are padded. You could also specify VARCHAR data types, which are not padded (unless writing to a fixed-width format text file).
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