check the presence of required fields and format of fields

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Pagadrai
Participant
Posts: 111
Joined: Fri Dec 31, 2004 1:16 am
Location: Chennai

Re: check the presence of required fields and format of fiel

Post by Pagadrai »

arun@sinmax wrote: I need to check the presence of required fields and format of fields.

I tried by len(record) = length of record given in the metadata, but it doesn't work, also i tried using DCOUNT(record,'000'),it works for 05 Records but not for 10 and 15 type.
Hi Arun,
Can you provide more details about the file format -
Any delimiters
How many fields are there and
what format are you validating?

What is the purpose of DCOUNT here ?
v2kmadhav
Premium Member
Premium Member
Posts: 78
Joined: Fri May 26, 2006 7:31 am
Location: London

Post by v2kmadhav »

if your trying to fit each type of a record into a consistent metadata...

you can read the file as a big varchar field....

split them into type based on first two values like you tried
and
then analyse if they can be delimited or treated as fixed length...

either after writing a set of substring derivations within the same job
or
into two sequential files each for type 05 and type 10 and write seperate jobs.
arun@sinmax
Premium Member
Premium Member
Posts: 13
Joined: Tue Jun 14, 2005 6:25 am

Post by arun@sinmax »

I seperated the fields as you mentioned in the previous posts,but i need, how to check the presence of required fields and format of fields.

Suppose in the record a value for a column is mismatching with the metadata given, i should reject the entire flow for that i need to find the invalid records.


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

Post by ray.wurlod »

Use stage variables for the target of your parsing, and detect whether each is populated.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arun@sinmax
Premium Member
Premium Member
Posts: 13
Joined: Tue Jun 14, 2005 6:25 am

Post by arun@sinmax »

Hi Ray,

Thanks for your reply,

How to find, whether each field is populated correctly or not

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

Post by ray.wurlod »

Create more stage variables whose derivation expression tests the business rule(s) applicable to each of the first set of stage variables.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply