handling nulls

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
datastagedw
Participant
Posts: 53
Joined: Fri Mar 07, 2008 1:17 am

handling nulls

Post by datastagedw »

hello friends,

i have a simple issue but is not getting resolved.

i have some not null fields coming from OES and being written to a SFS using a Tfm. i have both varchar fields and date and decimal fields. I am able to take care of the warnings for varchar fields by putting Null value='' but this does not work for decimal and timestamp and date fields.it still gives warnings like this.

R_PPS_RECHARGE_FILE: When checking operator: When validating export schema: At field "RECH_EXP_OFFSET": "null_field" length (1) must match field's fixed width .

the SFS also has these fields as not null fields. i can resolve this by handling nulls by using the relevant datatype and length for eg. for decimal field of length 10 i am able to handle in the edit row section by giving 0000000000 but the requirement is to use blank wherever i have nulls.(regardless of the datatype). is it possible?

pls help. if any info is insufficient i apologise
ETL DEVELOPER
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use the right number of blanks.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL

Set this to true and it should allow a zero length ('') for the NULL value in the decimal fixed width field upon export. :)

The parallel Job Advance Developer Guide document states the following for the above environment variable:

Code: Select all

APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL
When set, allows zero length null_field value with fixed length fields. This
should be used with care as poorly formatted data will cause incorrect
results. By default a zero length null_field value will cause an error.
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
datastagedw
Participant
Posts: 53
Joined: Fri Mar 07, 2008 1:17 am

Post by datastagedw »

ray.wurlod wrote:Use the right number of blanks. ...
well using right number of blanks?? how do we specify 'no of blanks'. I am sorry i did not get u
ETL DEVELOPER
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If the Field Width is, for example, 10, then supply 10 space characters.

Code: Select all

"          "
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
datastagedw
Participant
Posts: 53
Joined: Fri Mar 07, 2008 1:17 am

Post by datastagedw »

ray.wurlod wrote:If the Field Width is, for example, 10, then supply 10 space characters.

Code: Select all

"          "
...

thanks u ray for your quick response once again.

yes ray what u said is fine but the requirement is not to have spaces in the field it should take '' i.e, null. its taking simply by using the property null value='' in the format page of SFS but i don't want the warnings. I tried what u suggested before also it works without warnings but as i sais spaces are not acceptable.

and i also could not find the env variable that the other person suggested.
ETL DEVELOPER
Post Reply