Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cognos Script - need exit code

Status
Not open for further replies.

stacybost

Programmer
Aug 1, 2003
57
US
Hello,
I am new to the forum, as we are currently implementing Cognos. I hope someone can help me... we have several Cognos macros that we want to schedule with our scheduling tool, which is Autosys. The macros update Access Manager, build cubes, etc.

Our existing Autosys jobs run a command and evaluate the success or failure of the job based on the return value passed back by the command. For example, we might use Autosys to run a kshell script on Unix, and if it is successful it returns a 0, if it fails it returns an error code > 1.

Is there a way for a Cognos macro to return an exit code? We have tried VBS wscript.quit but it does not work. I haven't seen anything in the documentation and Cognos support has not yet provided a solution.

Thanks for your help!
Stacy
 
Well, if nothing else, simply write to a file as part of the macro, and include error handling, so if the code works, write a 1 to result.txt, if it errors, the handler can right a 0 to the file?
 
Thanks, that gives me some ideas.

We're currently doing something like that. We're writing to a success.dat or failure.dat. When we run the macro, our scheduler immediately thinks the job was successful. So we set up a "Filewatcher" job to run immediately after the macro job to look for the file. But our problem is that we can only run one Filewatcher job in Autosys (so we look for the success file, and if it's not found after a certain amount of time elapses, we assume the job failed, which is not good for many reasons).

What we could do is write to one file, write 0 to the file for success or the error code to the file for failure. After the Filewatcher job finds the file, run another cmd or vbs job to grab the value from the file and pass it to the scheduler. Then we'll know immediately if there's a failure.

Incidentally, I never found a way to pass an exit code back to the OS with Cognos Script. Cognos Support put it in as an enhancement request.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top