validate file

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
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

validate file

Post by Nagac »

Hi

How do we validate the flat file whether the files are having headers, Trailers and Details. If any one is not there, job should get aborted.

Could anyone advise how do we implement this?
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

Can you please post the sample data with header,trailer and details?
pandeeswaran
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What do you mean by "validate"? Do you have specifications?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

ray.wurlod wrote:What do you mean by "validate"? Do you have specifications?
I need to check the file whether it has HEader/Trailer. As File has identifiers for each type of row. Eg: Header identifier : H as first character
Trailer:T
Details:D

I will post the sample data, i dont have it right now.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why not script this if all this is is a validation step? If the validation fails, don't run the processing job. Between a count of the total records in the file and a check to see how many records start with "H" and "T", you should be able to whip something up.

Use a Sequence job to run the validation and take the appropriate steps afterwards based on the results.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If file has one header and one trailer this is a trivial task to script. If the file might have multiple headers and trailers, the best solution is probably a DataStage job.
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