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
file validation
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
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.
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.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Re: file validation
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.
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).
Re: file validation
Thats what exactly i am doing it, working fine.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.