Within a job that reads from a sequential file and writes to a Data Set I want to do a simple IsNull derivation - if FieldA is NULL then output FieldB, else output FieldA. Currently I am doing this in a transformer using simple BASIC code. I want to know whether it can be done in another type of stage. I have heard transformer stage doesn't perform as well as most of the other parallel stage types.
I tried doing it in a Modify stage with the specification FIELDA:string = NullToValue (FIELDA, FIELDB) but I got the following error:
main_program: Error parsing modify adapter: Error in binding: Unknown conversion: NullToValue
Expected destination field selector, got: ")"; input:
FIELDA:string = NullToValue(FIELDA, FIELDB)
Options for handling a NULL field
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Options for handling a NULL field
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Re: Options for handling a NULL field
Hi
Syntax is
In specification
FIELDA = handle_null(FIELDA,FIELDB)
Sanjay
Syntax is
In specification
FIELDA = handle_null(FIELDA,FIELDB)
Sanjay
vmcburney wrote:Within a job that reads from a sequential file and writes to a Data Set I want to do a simple IsNull derivation - if FieldA is NULL then output FieldB, else output FieldA. Currently I am doing this in a transformer using simple BASIC code. I want to know whether it can be done in another type of stage. I have heard transformer stage doesn't perform as well as most of the other parallel stage types.
I tried doing it in a Modify stage with the specification FIELDA:string = NullToValue (FIELDA, FIELDB) but I got the following error:
main_program: Error parsing modify adapter: Error in binding: Unknown conversion: NullToValue
Expected destination field selector, got: ")"; input:
FIELDA:string = NullToValue(FIELDA, FIELDB)
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Thanks guys, the handle_null worked. This function does not appear anywhere in the Parallel Job Developers Guide, nor does it appear in the Developer's Help file, where are these functions documented?
According to the Modify stage help file "A full listing of the conversion functions available is given in Parallel Job Developer's Guide." This doesn't appear to be the case.
According to the Modify stage help file "A full listing of the conversion functions available is given in Parallel Job Developer's Guide." This doesn't appear to be the case.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
I tried using Handle_Null as above but it doesn't work.
TRANSACTION_DATE=Handle_Null(TRANSACTION_DATE,CREATED_TIMESTAMP)
TRANSACTION_DATE AND CREATED_TIMESTAMP are TIMESTAMP columns
The job fails with the following error:
check_nulls: Error when checking operator: When binding output schema variable "outRec": When binding output interface field "TRANSACTION_DATE" to field "TRANSACTION_DATE": Bad literal for type timestamp: CREATED_TIMESTAMP [api/interface_rep.C:1103]
I also tried creating a new output column but same error.
In another post, I read that Modify stage accepts only one argument, the others are supposed to be constant. Does that apply to Handle_Null? I tried replacing the second argument with a literal and it worked. How come it works for others as they claim above? I'm using version 7.1
Thanks
TRANSACTION_DATE=Handle_Null(TRANSACTION_DATE,CREATED_TIMESTAMP)
TRANSACTION_DATE AND CREATED_TIMESTAMP are TIMESTAMP columns
The job fails with the following error:
check_nulls: Error when checking operator: When binding output schema variable "outRec": When binding output interface field "TRANSACTION_DATE" to field "TRANSACTION_DATE": Bad literal for type timestamp: CREATED_TIMESTAMP [api/interface_rep.C:1103]
I also tried creating a new output column but same error.
In another post, I read that Modify stage accepts only one argument, the others are supposed to be constant. Does that apply to Handle_Null? I tried replacing the second argument with a literal and it worked. How come it works for others as they claim above? I'm using version 7.1
Thanks
luie