Validation with log for each record

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
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Validation with log for each record

Post by myukassign »

Hi I have a situation where I would like to get some ideas to crack.

id, sales_date, desc, qty

1,'2008-10-9','suzki',100
1,'2008-10-9','mitsu',100
1,'2008-10-9','jaugur',100
1,'2008-10-9','aston',100

The requirement is to validate the format of each record and datatype of each record and if it did not match with the requirement for each record it should write a flag in the log file. It should do this validation for all records. Please tell me whats the best approach.

e.g.

if the first record was like this, one column is missing, it should write a log
1,'2008-10-9','suzki'

or if it is like this, one extra column...still it should write to a log file(txt file)

1,'2008-10-9','suzki',100, 'aaa'

or if it is like this , third field is not varchar, still should log

1,'2008-10-9',0000,100

any help the best method to do it....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do it all in a Transformer stage with a second output (or more than one) for the log. Make use of stage variables for decision making.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You might want to flag each record with the validation error(s) that caused the reject, unless you don't mind figuring it out all over again later.
-craig

"You can never have too many knives" -- Logan Nine Fingers
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Post by myukassign »

In my case...

I want to check if it the incoming value is interger or not , float or not, etc...


I browse through the functions availabe and I couldn't see any function that check the data type of a field and return True or flase...

pls help
nitkuar
Participant
Posts: 46
Joined: Mon Jun 23, 2008 3:09 am

Post by nitkuar »

Try IsValid function
Post Reply