Null field handling within Schema 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
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

Null field handling within Schema file ?

Post by benny.lbs »

I have a simple job contain only one Dataset stage and one Sequential File stage, what I want to do is DS --> SF. And I would like to make this job reuseable for all file layout. So I use the "Schema File" property to setup the schema in Sequential File stage.

However, there is no null field handling in Sequential File stage because of no specific column was loaded, when the input Dataset has null value, then the sequential file stage will reject all the records that with null value.

How to solve the problem ? Can we specify the null field handling within Schema File ?

Thanks in advance !
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
You can try solving this in the sequential file's stage configuration.
this was covered extensivly please search this forum.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

Post by benny.lbs »

in which keyword should I search ? There are lots of doc about sequential file stage in this forum. Would you please show me some links.

Thanks a lot !
roy wrote:Hi,
You can try solving this in the sequential file's stage configuration.
this was covered extensivly please search this forum.
IHTH,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The word "nullable" would be a good start.

Code: Select all

record
(
  lastname: string[max=16];
  middlename: nullable string[max=16];
  firstname: string[max=16];
)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

Post by benny.lbs »

That means "Null Field Value" can be setup within Schema file ? If yes, that is great.

I got the answer.

Code: Select all

record
(
  lastname: string[16];
  middlename: nullable string[3] {null_field='\xFF\xFF\xFF'};
  firstname: string[16];
)
ray.wurlod wrote:The word "nullable" would be a good start.

Code: Select all

record
(
  lastname: string[max=16];
  middlename: nullable string[max=16];
  firstname: string[max=16];
)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Congratulations of the success of your research! :D
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