PxCFF Stage - how to set null default values for decimals

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
Alethesnake
Participant
Posts: 56
Joined: Mon Mar 26, 2007 8:48 am
Location: Blue Bay (La Spezia)

PxCFF Stage - how to set null default values for decimals

Post by Alethesnake »

Hi All,
I have se following issue.
I have to read an EBCDIC Binary file and I use a PxCFF stage. Actually I have a decimal field that could be empty (Low Value in host). If a low value is found in a decimal field the default value set in:

Stage properties - Stage - Record Options - Default Values - Decimal

is used. I'd like to set this default value to "null", is it possible? It seems that the box accepts only numbers.. Any help is apreciated.

Thanks,

Ale.

PS: I can also make the host field contains a different value for the field that the low value.
...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Why not set it specifically for the column. right-mouse-click on the column name and "edit row" to get to where you can specify the column specific handling of default values.
Alethesnake
Participant
Posts: 56
Joined: Mon Mar 26, 2007 8:48 am
Location: Blue Bay (La Spezia)

Post by Alethesnake »

Thanks for your suggestion ArndW, I didn't see it :-)

Do you know how can I represent the null value?

Thanks a lot.

Ale.
...
newtier
Premium Member
Premium Member
Posts: 27
Joined: Mon Dec 13, 2004 5:50 pm
Location: St. Louis, MO

Post by newtier »

In the "Edit Row" for that column, under Properties | Nullable, add the Available properties to add: Null Field Value.

Set the value to whatever that is the "exact length" as specified in the Length field. For instance, if Length=7, Scale = 2, set the value to 000000.00 (9 bytes).

If you don't set it to the exact length you will still get a warning like the following:

Sequential_File_1: When checking operator: When validating export schema: At field "DEC_NULL": "null_field" length (3) must match field's fixed width (9) [impexp/group_comp.C:4565]
Rick H
Senior Consultant
Alethesnake
Participant
Posts: 56
Joined: Mon Mar 26, 2007 8:48 am
Location: Blue Bay (La Spezia)

Post by Alethesnake »

newtier wrote:In the "Edit Row" for that column, under Properties | Nullable, add the Available properties to add: Null Field Value.

Set the value to whatever that is the "exact length" as specified in the Length field. For instance, if Length=7, Scale = 2, set the value to 000000.00 (9 bytes).

If you don't set it to the exact length you will still get a warning like the following:

Sequential_File_1: When checking operator: When validating export schema: At field "DEC_NULL": "null_field" length (3) must match field's fixed width (9) [impexp/group_comp.C:4565]
Hi newtier,
Thanks for your reply. I tried to do it with the sequential file stage and it runs well.
However my needs are to read from a PxCFF stage and write its content to a dataset.
The PxCFF stage does not have the mentioned property, the only way I found is to set a default value to substitute an unreadable field (a field with a low value in example), but I am not being able to set a "null" default value.
I tried \0, \000, etc but no one runs well (I get an error in viewing data: value not admitted for a decimal field).

Any idea?
...
Post Reply