Avoid warnings when Wait for file Timeouts.

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

kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Avoid warnings when Wait for file Timeouts.

Post by kris007 »

Hi All,

I have a job sequence which is developed in the follwing way

Code: Select all


WaitforFileActivity-------OK------>>>JOB1
       |                                               |
       |                                               V
       |---------Failure(Timeout)->>> Sequencer(Any)------>>JOB2
So, whenever it finds a file it needs to run JOB1 and if it timeouts waiting for the file it needs to run JOB2. Now, whenever it timeouts, the Jobsequence finished with warnings(with Status=2 or Finished(Seelog)).

Is there a way I can avoid those warnings because even if it time outs I need JOB2 to run. Any guidance could be of great help.

Thanks
Kris.
velagapudi_k
Premium Member
Premium Member
Posts: 142
Joined: Mon Jun 27, 2005 5:31 pm
Location: Atlanta GA

Post by velagapudi_k »

I think Otherwise trigger will help. Try that.
Venkat Velagapudi
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

No, it still writes warnings to log. I tried that .

Thanks
Kris
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

So right now, even though your wait for file activity stage is timing out, your Job2 is not executing?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

JOB2 runs either ways--if the file is found or if WaitforFileActivity timeouts( Since Sequencer is set to ANY). But when it timeouts, My Jobsequence finishes with Warnings. I dont want that to happen. Is there a way I could avoid it.

Thanks
Kris.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I highly doubt it Kris. Let me make a little bit of more research, but i dont think you can demote a warning to an informational message in server. I know this can be done in PX, but not in server.
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 »

No, there's no 'demotion' in Server. All you can do is avoid generating them, if at all possible.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Ok.. is it possible to avoid it with the above Job design? Any inputs would be great because everytime my Sequence finishes successfully, technically it still finishes with warnings.

Kris.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not sure off the top of my head. I'd need to experiment and unfortunately I don't have time to do that right now. Perhaps later tonight I can, but right now anyone else is welcome to take a whack at this.
-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 »

O wow. I just wrote a unix script for you. Right before posting i saw that your server is windows. I hate it when this happens. :oops:
Sorry buddy, if you were on unix, i could have sent you a script to achieve the same functionality as wait for file activity but since you are on windows, i cant help you much there. If you know how to write batch jobs, i can tell you the logic. :?
Anyways.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Hi Kris,

You can try adding your sequence job to the job control of a new server job and then modify the job control to restrict the warnings.

I'm not really sure that it will work. but you can give it a shot.

Thanks,
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

DSGuru,

Can you post the logic so that I can try writing the batchfile.

Thanks Naveen. Will give that a shot and let you know.

Thanks
Kris
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Sure
Here you go

Code: Select all

#!/usr/bin/ksh
#time is the session timeout period in seconds.
time=$1
integer i
i=0
while [ $i != $time ]
do
   if [ -f /cgiproducer_dw/Conversion/Temp/M.txt ]
   then
      i=10
      echo 'File Found'
      exit 1
   else
      sleep 1
      i=i+1
      echo 'File Not Found'

   fi
done
exit 0
In your job design, you will replace the wait for file activity with Execute Command stage. Call the script from there (in your case the batch job).
Have two links coming out of it.
IF file is found then linkA else after timeout, linkB
In the triggers the expression type for linkA will Return Code and the expression will be 1
For the other link also the same, the expression will be 0.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Good so far, now rewrite it as a DOS bat file, as the OP requested!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What exactly IS the warning that is logged? Is it, in fact, from the WaitForFile activity at all, or from some other part of the job sequence? Have you investigated this fully?
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