Fail a job when file pattern not found

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
UPS
Premium Member
Premium Member
Posts: 56
Joined: Tue Oct 10, 2006 12:18 pm
Location: New Jersey

Fail a job when file pattern not found

Post by UPS »

I have a job the that uses file pattern to pick up all the files in a directory that has a specific file pattern.I want the job to fail when there is no file with that pattern but the job just shows a warning that there is no file and does not fail. Please let me know how I can make the job to fail.Thanks in advance
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

You can promote that particular warning to Fatal Error message using Message handler.
Or you can pre check the number or rows with the given file mask in unix and not to run the job at all.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

How many Sequential File Stages do you have in your job? Are you trying to read other files with different wild cards or names in the same job? I have seen this happen when there were multiple Sequential file stages within the same job and one of the file was not present in the directory the job was expecting to be.
Kris

Where's the "Any" key?-Homer Simpson
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

How about a pre-job exec sh with the ls command ?
UPS
Premium Member
Premium Member
Posts: 56
Joined: Tue Oct 10, 2006 12:18 pm
Location: New Jersey

Post by UPS »

kumar_s wrote:You can promote that particular warning to Fatal Error message using Message handler.
Or you can pre check the number or rows with the given file mask in unix and not to run the job at all. ...
Thank you for the response...I understand what u are saying but I want to know if this can be handled using some kind of option in sequencial file or in datastage instead of using unix to do that.Please let me know
UPS
Premium Member
Premium Member
Posts: 56
Joined: Tue Oct 10, 2006 12:18 pm
Location: New Jersey

Post by UPS »

kris007 wrote:How many Sequential File Stages do you have in your job? Are you trying to read other files with different wild cards or names in the same job? I have seen this happen when there were multiple Sequential file stages within the same job and one of the file was not present in the directory the job was expecting to be.
Thank you for the response I am trying to read files using wild cards. I have only one sequencial file stage in the job .Let me know
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A before job subroutine that performs a check is the ideal way to solve this issue.
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