Conditionnal run of a job

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
bart12872
Participant
Posts: 82
Joined: Fri Jan 19, 2007 5:38 pm

Conditionnal run of a job

Post by bart12872 »

Hello,

I have a job I want to launch only if a certain file exist. So, i tried a wait for file in the before subroutine job but it doesn't work. The job statut is Aborted if the file is not present.
Do you have any suggestion on how to do this? I'm looking for a method not to complicated to implement because I have more than 10 jobs to launch by this way.

cheers,
bart.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Re: Conditionnal run of a job

Post by narasimha »

bart12872 wrote:So, i tried a wait for file in the before subroutine job but it doesn't work.
Have you tried the "Wait-For-File Activity" sequence in the Job Sequence?
That should satisfy your needs.
If it does not help, get back.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Do you need to wait for file or just check if it exists or not? If the former then look into narasimha's suggestion. If the latter then search this forum. I posted a routine, a simple one, a while back that returns a true or a false for file presence and absence respectively.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The WFF stage will do both, for the latter tell it to wait zero seconds and you get an existence check.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Doesnt it spit out a warning if file doesnt exist for the very same reason ?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Here's the routine I was talking about:
viewtopic.php?t=100401
Go to the second page. You can remove the timeout part if you want.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

DSguru2B wrote:Doesnt it spit out a warning if file doesnt exist for the very same reason ?
I believe that is a true statement. May or may not be an issue for folks, if so a quick "if -s" or other UNIX file check could easily be run in a Command stage. For Windows... [shrug]
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

For window, BASIC rules. You should be remembering the post that i embedded in my previous reply. You also posted lines of what was the Grand Father version of WFF stage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yup, many moons ago I posted such. I checked your previous post and I found a korn waiting style script, didn't notice anything for Winders...
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

On the second page.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply