Null handling on timestamp fied in modifystage

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
reddy12
Participant
Posts: 99
Joined: Tue Aug 08, 2006 9:34 pm

Null handling on timestamp fied in modifystage

Post by reddy12 »

how can i handle null on timestamp in modify stage?
in specification properties what can i write? give suggestion.

Thanks
diamondabhi
Premium Member
Premium Member
Posts: 108
Joined: Sat Feb 05, 2005 6:52 pm
Location: US

Post by diamondabhi »

Again search would be a good thing to do:

(from another post): One way nulls can be handled is

When you have this problem of dates being null and you wish to use them in routines or stage variables, it can be usefull if you have a 'special date' that is outside of the domain of your data, i.e. 9999-12-31, which you can use set null dates to using

Code:
NullToValue(input.date, StringToTimestamp('9999-12-31 00:00:00', '%yyyy-%mm-%dd %hh:%nn:%ss'))
Every great mistake has a halfway moment, a split second when it can be recalled and perhaps remedied.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

A small correction here. NullToValue() will work only in the transformer stage. It wont in the modify stage. There is a mistake in the parallel guide. Use handle_null(). Search on the name for its exact syntax.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
reddy12
Participant
Posts: 99
Joined: Tue Aug 08, 2006 9:34 pm

Post by reddy12 »

Thanks for your response DSguru2B

Can you please give me one example?
I am getting problem with that.
DATEFIELD=handle_null()
what can i specify in () ?
DSguru2B wrote:A small correction here. NullToValue() will work only in the transformer stage. It wont in the modify stage. There is a mistake in the parallel guide. Use handle_null(). Search on the name for its exact syntax.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

It will be same as the NullToValue.

Code: Select all

DateFiled=handle_null(FieldName, "NULL")
IHTH
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
reddy12
Participant
Posts: 99
Joined: Tue Aug 08, 2006 9:34 pm

Post by reddy12 »

I specified in properties like below
specification=DATE = handle_null(DATE," ")

I am getting the below Error.

Modify_14: Error when checking operator: When binding output schema variable "outRec": When binding output interface field "DATE" to field "DATE": Bad literal for type timestamp: .

Please help me
us1aslam1us wrote:It will be same as the NullToValue.

Code: Select all

DateFiled=handle_null(FieldName, "NULL")
IHTH
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Check your other post...
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
reddy12
Participant
Posts: 99
Joined: Tue Aug 08, 2006 9:34 pm

Post by reddy12 »

I checked.Thank you very much for your quick response.
us1aslam1us wrote:Check your other post...
Post Reply