Handle Null for fixed width data type having width >= 100

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
ks489
Participant
Posts: 14
Joined: Fri Apr 15, 2005 1:45 pm

Handle Null for fixed width data type having width >= 100

Post by ks489 »

Hello everyone,

I want to find a solution as to how i can define a NULL for fixed width data type like char (10), decimal(10) date(10) in SEQUENTIAL File Stage in PX, while exporting data to a physical file.

* i have nulls in my data. data defn is -> ITEM_DESC CHAR (100)

i know if the width is 10, i can achieve this by doing something like below, and it works absolutely fine.

1. Set Nullable = Y
2. Set Null field value (in Parallel / Nullable settings) to ' ' (/* 10 spaces */)

Now for a 10 width character field this will work fine.

But my problem is that i have a 100 byte (/character) description field describing about an item.

It is highly impossible for me to type ' ... spaces 100 times '

Can any one suggest something else.

One more constraint. i dont not want to use a Transformer because just using a Transformer for doing something like IsNull (...) and then handling it using a function like -> ... Space(100) would cost me.

Also i do not want to use Modify stage.

What i would like info would something on the lines how i can use 'ACTUAL FIELD LENGTH' and 'NULL FIELD LENGTH'

i tried setting attribute ACTUAL FIELD LENGTH =100, and FILL CHAR = Space, but it complains saying it should be used with null_field length

exact message : Seq_Desc: Error when checking operator: At field "ITEM_DESC": "actual_length" can only be used with "null_length"

So i tried using null-field length = 100.
Again it gave an FATAL error saying :
Seq_Desc: Error when checking operator: At field "ITEM_DESC": "null_length" may only be used in conjunction with prefix length or link length.

ANY SUGGESTIONS why / what is happening ?

I tried to be as detailed and elaborative as possible..

thanks all for your valuable time.

warm regards,
Kash.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
How about checking for a trimmed column being an empty string?

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
ks489
Participant
Posts: 14
Joined: Fri Apr 15, 2005 1:45 pm

It wouldnt eliminate the warnings.

Post by ks489 »

roy wrote:Hi,
How about checking for a trimmed column being an empty string?

IHTH,
Ofcourse i can do that, only thing i dont want to use a Transformer. Also checking for trimming wouldnt eliminate the warning :

Seq_Desc: When checking operator: When validating export schema: At field "ITEM_DESC": Exporting nullable field without null handling properties.

/* Seq_Desc is a Sequential File Stage in PX job */

-Kash.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Reading from sequential files in EE means reading characters! not numeric/dates or anything else except character types this is even "forced" (not by DS) more when your reading a fixed width file as you experianced, especially when your numeric values are not preceded by zeros and yes the scheme should be all fields as not null.

After clearing that there is only the issue of how you convert this string to the type you want it to be.

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
Post Reply