Page 1 of 1

'Line Feed' that doesn't disappear

Posted: Tue Jan 08, 2013 10:35 am
by joycerecacho
Hello friends.

I have a problem.

I am generating a Sequential File through DataStage and there is a column that always shows a strange character at its beginning like that 'char(10)', in other words, that little rectangle which means the 'Line Feed'.
It causes the file truncation.

We have already tried to use the Convert function to substitute the char(10) to '', or the char(13) to '' and other ascii codes, but it didn't work.

The funny thing is that, independent on the column derivation, ex: derivation = 'a' or derivation = Link.COLUMN, always this character appears.

It is not shown at the DataStage File view, I just can see it if I open the file at the Notepad or at the Unix terminal.
Looking through DataStage, the file is apparently ok.

If I change the columns order at the file, the strange character still appears, at the new column position and at the beginning of the column.

So strange.
"Independent on its derivation".

What can it be?

Thanks anyway, guys.....

Posted: Tue Jan 08, 2013 10:47 am
by ArndW
What are your sequential file settings?
Also, since you are on unix, do an "od -x <file>" to see what the ascii code of the character in question really is, it might be an 0x00

Posted: Tue Jan 08, 2013 10:53 am
by joycerecacho
First of all, thank you for the answer.

What do you mean by: see if the ascii code is 0x00 ? What '0x00' means?

Here we are using the APT_STRING_PADCHAR environment variable set like 0x20, but actually I don't know exactly what it means.

Thankss!

Posted: Tue Jan 08, 2013 10:54 am
by chulett
As noted, you really need to identify the character in question, its specific value. Only then will you be able to deal with it properly.

Posted: Tue Jan 08, 2013 10:58 am
by joycerecacho
joycerecacho wrote:First of all, thank you for the answer.

What do you mean by: see if the ascii code is 0x00 ? What '0x00' means?

Here we are using the APT_STRING_PADCHAR environment variable set like 0x20, but actually I don't know exactly what it means.

Thankss!
Here we are using the APT_STRING_PADCHAR environment variable set like 0x20, but actually I don't know exactly what it means.

Thankss!

Posted: Tue Jan 08, 2013 11:07 am
by joycerecacho
chulett wrote:As noted, you really need to identify the character in question, its specific value. Only then will you be able to deal with it properly. ...
I identified that the characters are: Null + Vertical Tab (ascii 11)

But the convert function didn't work.

The APT_STRING_PADCHAR could cause this?
Configured as 0x20.

Thanks..

Posted: Tue Jan 08, 2013 12:22 pm
by max.madsen
Joy,

Try use "od -x <file>"
Purpose: Displays files in a specified format.
The parameter x specifies offset base is display in hexadecimal.

If identify the character is null, use convert function to substitute the char(0) to ''.

Posted: Tue Jan 08, 2013 3:49 pm
by ray.wurlod
0x20 is a shorthand way to specify the hexadecimal number 20, which is the same as 32 using a decimal base.

The character whose ASCII code is 32 (in decimal) or 20 (in hexadecimal) is the space character (" ").

If your data contains Vertical Tab characters use Convert() function to remove them. As you note, these are represented as Char(11).
Tip: initialize stage variable svVerticalTab to Char(11) so that the Char() function only has to be executed once.

Similarly the ASCII NUL character can be represented as Char(0).

Posted: Fri Jan 11, 2013 1:26 pm
by joycerecacho
Hi Ray!
I took out this environment variable to test, and the problem still happens.
I also created the stage variable as Char(22) - the exact lenght of its content and it didnt work again. - I started it with ascii char(11).
In another job wich this problem used to happen, I changed the field definition, from varchar() to char(22) - the exact lenght of the content, and it worked. I don't know why in this other job, a similar one, this strategic fails.
Let's keep on trying.

Thanks anyway, friends.

Posted: Sat Jan 12, 2013 3:41 am
by ArndW
Convert(Char(11):Char(0),'',In.Column) should work to remove those 2.

Posted: Mon Jan 14, 2013 11:54 am
by joycerecacho
Hi guys.
For my surprise, in another Transformer, I created a VarChar field and in its derivation I wrote the same content and that special caracter didnt appear any more.

I really couldn't understand. I just created the Field in another transformer, with the same derivation.

Is it a Bug?

I can't explain.

Thanks for your help, guys!!!!!