COGNOiSe.com - The IBM Cognos Community

ETL, App Development and other tools => COGNOS DecisionStream/Data Manager => Topic started by: sappleg on 31 Mar 2009 11:58:03 AM

Title: Handling job stream failure on command line (Decision Stream)
Post by: sappleg on 31 Mar 2009 11:58:03 AM
Hi Guys,

I have two Decision Stream jobs. For example, one being 'Master_J' and another 'Inventory_J'. I am running them both one after another in a batch file as a command line. Here's the example below:

"d:\program files\rundsjob.exe" "ORACLE" "abc/def@ghi" "MASTER_J" -L%LOGDSJ% -VTRACE_VALUES=PROGRESS,DETAIL,SQL,USER,VARIABLE

"d:\program files\rundsjob.exe" "ORACLE" "abc/def@ghi" "INVENTORY_J" -L%LOGDSINV% -VTRACE_VALUES=PROGRESS,DETAIL,SQL,USER,VARIABLE

Now my question is, how to handle the failure in between these jobs. If the first job 'Master_J' ends up in failure, I don't want the 'Inventory_J' to execute. Currently, if there's a failure in first job, it still proceeds to the second one because of no condition. Is there any condition I can add in between these two jobs on either the command line or in the ETL logic?

Can someone please provide any example?
Any help is greatly appreciated.
Thanks.
Title: Re: Handling job stream failure on command line (Decision Stream)
Post by: UseCog on 03 Apr 2009 05:49:42 AM
Hi,

As both of these jobstreams are created in same DS package, why dont you create another jobstream in DS and pull those two jobstreams and into that and set it to your requirement ( I havent used DS, but I think it should be possible.

If the above is not possible, you can create 2 DOS batch scripts for each of the jobstreams and create a third one to handle your situation. I have done this type of scripting long back, so cant remember.

regards,
UC
Title: Re: Handling job stream failure on command line (Decision Stream)
Post by: onevedrov on 01 May 2009 04:49:53 PM
Yes. you can. If you decide to use jobstream, then you can add condition node after first job and check the result variable. result variable is default and has 2 values true or false. You can also achieve the same result in batch file, but you have to know the windows commands to achieve it. it will  be easier in jobstream.

good luck.
Title: Re: Handling job stream failure on command line (Decision Stream)
Post by: jeamsx on 18 May 2009 10:06:43 AM
You can try to create a job stream or you can test the command above:

IF("command to run the build" EQU 0 ) "the second build command"

[]s