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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a cube building bat file at the end of a DataStage batch 2

Status
Not open for further replies.

JGirl

Programmer
Aug 21, 2002
210
AU
Hi,

I tried posting this in the DataStage forum, but didnt get any responses, so I am going to try my luck here instead.....

At my organisation, we run a DataStage batch each night to update our data. Once this batch has finished running, I would like to be able to kick off a bat file to build several cognos cubes.

We are currently using cognos scheduler, but the limitation with this is that our batch finishes at different times each night, and noone wants to be awake at 3am checking the batch and kicking the file off manually.

I dont know too much about it, but apparently (way before I started) we were using some sort of VB functionality to do this (In case you cant tell, I know nothing about VB!), but that didnt work when we upgraded DataStage.

Also, we originally had some code in the batch itself to kick off the bat file, but there were problems with multiple windows being opened on the server.

Does anyone have any ideas on how I could (relatively easily!) automate the cube building bat file, to kick off as soon as the batch has completed? I would prefer any ideas that allow the DataStage batch to actually finish before the file is kicked off, rather that keep running while the bat file is executing, but any ideas will do at this stage.

Help Me Please!!!!!

Cheers
JGirl
 
JGirl,
We are also a Datastage(5.1) and Cognos (Series 7) site and here is what we do. At the end of the last datastage job simply put in an 'After-Job Routine' that calls a batch file (Eg. ExecDos D:\Cognos\Macros\BuildCube.bat) and make sure that the Check Box 'Only run after-job subroutine on successful completion'. The buildcube.bat should contain a simple Cognos macro to start the cube build.
If you already use after job routines (and since you can only have 1 per job) either write a subroutine that contains your existing job routine and then the ExecDos (or ExecSH if your Unix based), or put the entire DS batch in a wrapper that simply starts the first job and then has your own After Job Routine.
This worked fine for us, then we split the DS Server and Cognos server onto different machines. If this is the same with you change your After Job Routine batch file from starting a Cognos Cube Build to placing file on a shared network point that both machines can view/modify(We use something like Z:\Triggers\Datastage.completed). On the Cognos machine we the schedule in NT Scheduler a processes that every 5 minutes, checks for the 'trigger' file (in Unix we use Cron), if it finds the file, it deletes it and starts the Cube build.

Our batch file on the Cognos server looks like this :

echo ---------------------------------- >> Cognos.log
date /T >> Cognos.log
time /T >> Cognos.log
echo ***Looking For Z:\Triggers\Datastage.completed *** ***Version 1.00*** >> Cognos.log
Z: >> Cognos.log
cd "\Triggers" >> Cognos.log
if not exist Datastage.Completed goto NotFound >> Cognos.log

del Datastage.completed >> Cognos.log
D:\Applications\Schedules\Cognos >> Cognos.log
goto End

:NotFound
echo Trigger file not found. Exiting >> Cognos.log

:End

Hope that helps

Starg

** I changed all the Paths etc so the log files in the above version will not be correct.

PS. Something I just thoughtof, you could start the Datastage processes from within a Cognos macro.. just another idea
 
Starg,

Thanks a million for the ideas. Now I just have to test them out!

Thanks again.
JGirl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top