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

Transformer not shutting down

Status
Not open for further replies.

sudhirnr

Programmer
Nov 17, 2005
5
0
0
US
Hi

I am building Transformer through a VBScript like this

answer = objShell.Run("D:\Cognos\cer3\bin\trnsfrmr.exe -n ""E:\Webapps\BWDIS\DIS EMA Delivery Detail.pyi""", , True)

Set objshell= nothing

But after the Cube Build the Transformer does not shut down and the script will suspend at that point and only when the Transformer is physically shut down the script will start executing the next Cube build. I tried using the n2 option and even that is not exiting.

Appreciate if anybody can provide me with a solution to this issue.

Mucho Gracias

Sudhir
 
Try this instead:

Set go_objTransApp = CreateObject("CognosTransformer.Application")

Set go_objModel = go_objTransApp.OpenModel(location\modelname.py? or mdl)

go_objModel.CreateMDCFiles

go_objModel.Close

Set go_objModel = Nothing
Set go_objTransApp = Nothing

This isn't a script by any stretch, but these are the components you can use to build a cube in CognosScript/VBA automation.
 
Here you go, a written and tested script, just change things were neccessary, like path and model name and extension (I prefer mdl's over py?'s):

Sub Main
Dim lo_objTransApp as Object
Dim lo_objModel as Object

Set lo_objTransApp = CreateObject("CognosTransformer.Application")

Set lo_objModel = lo_objTransApp.OpenModel("C:\Cognos Reporting\Assessments.mdl")

lo_objModel.CreateMDCFiles

lo_objModel.Close

Set lo_objModel = Nothing
Set lo_objTransApp = Nothing

End Sub
 
Thanks CognosChicago!.

One question can the above snippet be used as a VBScript.

 
I don't see why not. It was written using the CognosScript editor, but it's pretty straight forward code. The objects are Cognos Transformer specific objects and should be available to use in VBScript or VB Code. All you can do is try.
 
Hi,

I tried running the script as vbscript and it won't work. I guess it should be executed as CognosScript which means I have to convert the existing VBScript (which includes e-mail messaging) to CognosScript.

Sudhir
 
You should be able to modify it to fit into VBScript, no reason you shouldn't that I can think of. Play around with it and see if there are syntax errors in your VBScript from the cognos specific portions.
 
Hi CognosChicago!

I have converted the script to follow your Cognos scripting, only issue is that I am not able to trap error conditions which I could using the VBScript, so I cannot use the conditional logic to send error notification email. The VBscript provided a return of variable answer which has the error code, whereas there is no way to handle the error code in the Cognosscript code. Let me know if you know any way to work this around.

thanks in advance,

Sudhir
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top