Validate Datatypes

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
kogads
Premium Member
Premium Member
Posts: 74
Joined: Fri Jun 05, 2009 5:36 pm

Validate Datatypes

Post by kogads »

Hello Everyone,
I have to validate input file datatypes and collect all the invalied records to the reject file.Presently iam using the stage variables, one for each field to validate. Valid = 0, Invalid = 1 and lastly sum them. Good row constraint: sum = 0, reject everything else.My question is how to make this job generic which can handle any metadata.Say if one input file have 3 date fields to validate and 2nd file have 10 date fields to validate is there a method to create only one job to validate all the files.Is it possible using schema file?If so how can we capture all the columns with a particular datatype say Date?

Thanks in advance
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

That is a difficult question, and I'm not sure it can be done. The schema could define default values for fields which don't validate and that value could be set to some common one outside the normal data range but that wouldn't work as a generic solution, unfortunately.
kogads
Premium Member
Premium Member
Posts: 74
Joined: Fri Jun 05, 2009 5:36 pm

Post by kogads »

ArndW wrote:That is a difficult question, and I'm not sure it can be done. The schema could define default values for fields which don't validate and that value could be set to some common one outside the normal data range but that wouldn't work as a generic solution, unfortunately.
I really appreciate if you have any idea to implement this...
kogads
Premium Member
Premium Member
Posts: 74
Joined: Fri Jun 05, 2009 5:36 pm

Post by kogads »

kogads wrote:
ArndW wrote:That is a difficult question, and I'm not sure it can be done. The schema could define default values for fields which don't validate and that value could be set to some common one outside the normal data range but that wouldn't work as a generic solution, unfortunately.
I really appreciate if you have any idea to implement this...
Hi,
I just want to update this post so that it doesnt go back in the list.I am waiting for any reply from the experts.

Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I agree with Arnd's assessment.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

Hi,
I am not sure about the generic job and schema file.But i can share you a workaround which can be of help.
Load all your req column names and their data types/code for all datatype( eg:0 for char,1 for num, 2 for date and so on)

Use your source file as your driver and do a look up using column names as your key on the file you have just created.get the data type/ corresponding code from the look up file and do the validation in the next stage a transformer and reject all the records which din't meet the requirements.


Regards,
Raja R P
Post Reply