Page 1 of 1

NULL & Sequential File

Posted: Sat Oct 02, 2010 11:38 pm
by karthi_gana
All,

what is the relationship between NULL and a sequential file?

does sequential file allows NULL ? say for example, if i declared variables like below

eno int No (Allow Null)
age int Yes (Allow Null)
ename varchar(50) No (Allow Null)

I have designed a jpb like below

ODBC --> Transformer ---> Sequential file

assume age has some NULL values in the table.

emp table : 50 rows

age is not null - 45 rows
age is null - 5 rows

how many rows will be transferred to the sequential file? i didn't try this. Because this question just came to mind when i open this site from my home. i don't have datastage in my home pc. i can use datastage only from my office.

Posted: Sun Oct 03, 2010 6:04 am
by chulett
Sequential files allow nulls, yes. The Server product makes handling them a little easier, basically you'll end up with a empty string / field unless (of course) you are writing out to a fixed-width file. In that case you'll need to supply something of the appropriate size for the field, typically spaces.

Posted: Sun Oct 03, 2010 12:20 pm
by ray.wurlod
Technically, because there are no data types in a text file (only text), text files do NOT support NULL. Therefore your metadata need to describe how NULL is represented within the file/field.

Posted: Sun Oct 03, 2010 2:48 pm
by chulett
Technically. :wink:

Posted: Sun Oct 03, 2010 2:52 pm
by ray.wurlod
C'est moi. 8)

Posted: Mon Oct 04, 2010 11:54 pm
by karthi_gana
chulett wrote:Sequential files allow nulls, yes. The Server product makes handling them a little easier, basically you'll end up with a empty string / field unless (of course) you are writing out to a fixed-width file. In that case you'll need to supply something of the appropriate size for the field, typically spaces.
If i didn't supply something...what will happen?

Posted: Tue Oct 05, 2010 2:39 am
by ray.wurlod
Depends how your "default defaults" have been set up.

Posted: Tue Oct 05, 2010 2:45 am
by nani0907
It throws warnings in the job for sequential file to handle nulls...

Posted: Tue Oct 05, 2010 6:31 am
by chulett
In a Server job? PX, perhaps, but not Server.

Posted: Tue Oct 05, 2010 9:31 pm
by karthi_gana
"default defaults" ???

how to see or view it? where to see this value?

Posted: Tue Oct 05, 2010 11:01 pm
by ray.wurlod
[In parallel jobs only...] :oops:
There is a button on the Format properties called Defaults> (or something like that). This allows you to set the current format settings as default, replace the current with your most recently saved default, or to restore factory settings.

Posted: Wed Oct 06, 2010 9:43 pm
by karthi_gana
ray.wurlod wrote:[In parallel jobs only...] :oops:
There is a button on the Format properties called Defaults> (or something like that). This allows you to set the current format settings as default, replace the current with your most recently saved default, or to restore factory settings.
oh...ok.