Converting Null into Not Null Using Modify Stage

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
tech_savvy
Participant
Posts: 48
Joined: Mon Oct 08, 2007 7:12 pm
Location: Sydney

Converting Null into Not Null Using Modify Stage

Post by tech_savvy »

I want to convert Null to Not Null of a column with data Type as Date. I am using Reprt_Date : string = NullToValue (Reprt_Date,"Null") in the Specification of Modify stage. But I am getting error as
"main_program: Error parsing modify adapter: Error in binding: Unknown conversion: NullToValue
Expected destination field selector, got: ")"; input:
Reprt_Date : string = NullToValue (Reprt_Date,"Null")
;
Error parsing modify adapter: Error in binding: Unknown conversion: NullToValue
Expected destination field selector, got: ")"; input:
Reprt_Date : string = NullToValue (Reprt_Date,"Null")
;"

Thanks In advance
Regards
Naveen Kandukuri
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

You should be using handle_null() instead of NullToValue which is a transformer function.
Scope
Premium Member
Premium Member
Posts: 63
Joined: Wed Jun 06, 2007 6:38 am
Location: Chennai

Post by Scope »

Hai,

Use this format

destField[:dataType] = handle_null (sourceField,value).

Reprt_Date :string = handule_null (Reprt_Date,"Null")

Modify Stage Has Seperate Orchestrate Functions.we can;tTransformations Stage functions in modify stage.
Kumarez
Scope
Premium Member
Premium Member
Posts: 63
Joined: Wed Jun 06, 2007 6:38 am
Location: Chennai

Post by Scope »

Hai,

Use below mentioned format ;

destField[:dataType] = handle_null (sourceField,value).

Reprt_Date :string = handule_null (Reprt_Date,"Null")

Modify Stage Has Seperate Orchestrate Functions.we can't use Transformations Stage functions in the modify stage.
Kumarez
tech_savvy
Participant
Posts: 48
Joined: Mon Oct 08, 2007 7:12 pm
Location: Sydney

The data type is Date

Post by tech_savvy »

when i am giving the above said Condition for Datatype Date, the error I am getting is
Modify_112: Error when checking operator: When binding output schema variable "outRec": When binding output interface field "Reprt_Date" to field "Reprt_Date": Bad literal for type date: Null.

Thanks in Advance
Regards
Naveen Kandukuri
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

"Null" is not a valid date value.

Your business rules has to decide what should be the default date when the input date is null. E.g 1500-01-01.

Reprt_Date : string = NullToValue (Reprt_Date,"Null")
What is Reprt_Date datatype when output? The above answer is applicable only if it is date.

Your specification should be:

Code: Select all

Reprt_Date :date = handle_null(Reprt_Date,"1500-01-01")
Post Reply