Page 1 of 1

fixed width columns and the default null string

Posted: Fri Sep 02, 2005 9:25 am
by hiltsmi
I am receiving fixed width files.

I would like to determine when a column value is null.

On the sequential file stage - outputs - format screen there is a field called "default null string".

Can someone explain how this is supposed to be used? My assumption was that if I put a value there and an incoming field has that value Ascential would treat it like a null. Is this correct?

I put in a value like "*" and I get the following error when I compile.

External null string '*' (1 bytes) is too wide for column c1 (0 bytes).

Which makes no sense.

Re: fixed width columns and the default null string

Posted: Fri Sep 02, 2005 12:06 pm
by kris
hiltsmi wrote:I am receiving fixed width files.

I would like to determine when a column value is null.

On the sequential file stage - outputs - format screen there is a field called "default null string".

Can someone explain how this is supposed to be used? My assumption was that if I put a value there and an incoming field has that value Ascential would treat it like a null. Is this correct?

I put in a value like "*" and I get the following error when I compile.

External null string '*' (1 bytes) is too wide for column c1 (0 bytes).

Which makes no sense.
When you are reading the fixed width file and want to determine if the column value is null, then trim(link.column) and check for the empty string in the transformer.

Code: Select all

trim(link.column)=''
default NULL string is used when you have SQL null in the data. You should not expect any SQL nulls in when reading fixed width file.

Kris~

Posted: Tue Sep 06, 2005 5:24 am
by hiltsmi
In this case an empty string and NULL are not the same thing. An empty string indicates no data was entered into the field but null indicates the data is unknown.

Posted: Tue Sep 06, 2005 10:48 am
by kris
hiltsmi wrote:In this case an empty string and NULL are not the same thing. An empty string indicates no data was entered into the field but null indicates the data is unknown.
Thats true.

Depending where the data is(database, files) and where we are checking, both empty string and NULL are different.

Kris~

Posted: Tue Sep 06, 2005 4:21 pm
by ray.wurlod
Because you're using fixed width, the representation of NULL will differ in different columns (since it has to be the same width as the column). In the Columns grid you can specify column-specific representations of NULL; scroll right until you find it.