Seq Looping Completion based action

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Seq Looping Completion based action

Post by nvalia »

Hi,

DS 8.7 on Windows

I am using a Start Loop and End Loop activity stage in a Seq job for a file pattern polling. On File Arrival I break of the loop and do the required action. This works fine.

But in case the loop finishes all its Iterations (means file did not arrive in pre-defined path) I need to send an email notification for File Not Arrival.
How can I trap this condition of Loop Completion to trigger something downstream (In this scenarion the seq job completes succesfully)

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

Post by chulett »

I would just have the 'file not found' processing come directly after the End Loop stage, that way when it exits normally you'll know it ran out of iterations.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Post by nvalia »

I did not understand this..From the EndLoopActivity it allows only Unconditional trigger and right now I have it back to the Start Loop..If I add another one here it will send an email for every iteration where as I want only for the last one

I achived this by having another link with a Custom trigger from the Execute Command stage (that executes a script for every iteration to poll the file else sleep and back) and have this custom condition as
Counter = EndLoopVariable ("To" part in the Mumeric Loop Definition, say 25) and Output from the script saying "File Not Found"..so this will only be executed for the last iteration, that too only if all iterations are executed...as I want

Thanks for your help
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

nvalia wrote:I did not understand this..From the EndLoopActivity it allows only Unconditional trigger and right now I have it back to the Start Loop..If I add another one here it will send an email for every iteration where as I want only for the last one
This is not correct. Yes, it will automatically link back to the Start Loop stage to complete the loop. You can add another link that goes from the End Loop stage to any processing you'd need or like to do after the loop completes normally.

There's no need for all the extra steps you are taking.
-craig

"You can never have too many knives" -- Logan Nine Fingers
crystal_pup
Participant
Posts: 62
Joined: Thu Feb 08, 2007 6:01 am
Location: Pune

Post by crystal_pup »

Hi Nvalia

As far as I know, the EndLoopActivity has only one Expression Type i.e Unconditional. However, how did you pass this Expression Type back to the Start Loop? If the EndLoopActivity completes all its iterations, then the control is passed onto the output link defined in Triggers tab of EndLoopActivity. If there is a execute command activity after the EndLoopActivity, then whatever is in the execute command activity, it will be executed just once.

Regards
Kunal
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Post by nvalia »

Thanks Chulett, that works.
Post Reply