file validation

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
vzmz
Participant
Posts: 36
Joined: Sun Nov 23, 2003 12:10 pm
Location: Dallas

file validation

Post by vzmz »

Hi All,
I have a sequential file of fixed length of 138 char; it can be more or less. What i have to do is separate the good ones from the bad ones, i mean any record which is not of size 138 has to pushed to a bad file and all the records of size 138 has to be pushed to good one.

How can i achieve this ?

What I have done was link that to another sequential file and a reject link to one more file. In the column field I have mention char 138. and fix length under format When I am trying to run this job the job is aborted if I have any record of length greater than 138.
Please help
Thanks in advance
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Try adding a column at the end of your valid columns called OVERFLOW, set this to whatever width you think your maximum column will come in under, eg. 128 characters. In the column definitions grid set the "Incomplete Column" value to "Replace" to ensure it gets a NULL when the row is a valid 138 characters in length.

Now in a transformer you can use the OVERFLOW column in a constraint, if the column is NULL then it is a valid row, if it is not NULL then you need to handle it as an error.
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Re: file validation

Post by Teej »

Get QualityStage to make life easier on this one.

If you must use Parallel...

Just read the file with no fixed length, and row terminated, and inside a transform stage, do a Len() on that input, and determine which is good, and bad, and deal with the results.

-T.J.
Developer of DataStage Parallel Engine (Orchestrate).
vzmz
Participant
Posts: 36
Joined: Sun Nov 23, 2003 12:10 pm
Location: Dallas

Re: file validation

Post by vzmz »

Teej wrote:Get QualityStage to make life easier on this one.

If you must use Parallel...

Just read the file with no fixed length, and row terminated, and inside a transform stage, do a Len() on that input, and determine which is good, and bad, and deal with the results.

-T.J.
Thats what exactly i am doing it, working fine.
Post Reply