'Line Feed' that doesn't disappear

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
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

'Line Feed' that doesn't disappear

Post 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.....
Joyce A. Recacho
São Paulo/SP
Brazil
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post 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!
Last edited by joycerecacho on Tue Jan 08, 2013 10:55 am, edited 1 time in total.
Joyce A. Recacho
São Paulo/SP
Brazil
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post 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!
Joyce A. Recacho
São Paulo/SP
Brazil
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post 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..
Joyce A. Recacho
São Paulo/SP
Brazil
max.madsen
Premium Member
Premium Member
Posts: 62
Joined: Tue Dec 07, 2004 7:41 am
Location: Brasil
Contact:

Post 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 ''.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post 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.
Joyce A. Recacho
São Paulo/SP
Brazil
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Convert(Char(11):Char(0),'',In.Column) should work to remove those 2.
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post 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!!!!!
Last edited by joycerecacho on Mon Jan 14, 2013 1:40 pm, edited 1 time in total.
Joyce A. Recacho
São Paulo/SP
Brazil
Post Reply