File Validation with schema and column import

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
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

File Validation with schema and column import

Post by thurmy34 »

Hi Gurus
We want to validate the data Inside our input files.
We use schema file and the reject of the stage Column Import.
We have issues with the column string not nullable , the Column Import does accept the rows with null columes (ie ;;).

Code: Select all

record  {final_delim='end', quote=none, delim=';'}
(
C1:string[max=24];
)
Thank you
Hope This Helps
Regards
Thomas.B
Participant
Posts: 63
Joined: Thu Apr 09, 2015 6:40 am
Location: France - Nantes

Post by Thomas.B »

DataStage see that value as a 0 length string, not a null.
Did you try to use the "Null field value" option on the "Format" tab ?
BI Consultant
DSXConsult
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

HI
First of all i have to add that in our schema file we have column before and after my example.
Can you clarify the format tab thing ? Is it the one in the ouput tab Inside the column import stage ?
If so what is the right value ?
Thank you for your help.
Hope This Helps
Regards
Thomas.B
Participant
Posts: 63
Joined: Thu Apr 09, 2015 6:40 am
Location: France - Nantes

Post by Thomas.B »

It is possible to set a string defining a null value in the Column Import stage or directly in the schema.
The easiest way is to add it to the schema, you can add the 'null field' property that way:

Code: Select all

record {final_delim='end', quote=none, delim=';'}
(
    C1:string[max=24] { null_field = '' };
)
To add the property to all the fields you can also define the keyword on the schema definition:

Code: Select all

record {final_delim='end', quote=none, delim=';', null_field = ''}
(
    C1:string[max=24];
)
BI Consultant
DSXConsult
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi
When we change the schema file we have the following error.

Ci_XXX: At field "Col2": "null_field" used on not nullable field

Regards
Hope This Helps
Regards
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Make it nullable.
-craig

"You can never have too many knives" -- Logan Nine Fingers
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

I can't because it's not and i want to identify the wrong rows ...
Hope This Helps
Regards
Post Reply