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!

Daily cube refresh 1

Status
Not open for further replies.

vinayaca

Technical User
Sep 20, 2001
4
0
0
GB
Hi,

I have a power cube built using cognos Transformer. We need to refresh this cube daily. I tried this using scheduler and its not working.

Can anybody tell me how a cube can be refreshed daily.

Cheers,
 
vinayaca,

We update cubes using scheduled mdl scripts within cognos scheduler.An example of the script is below:

OPENpy "N:\Cognos Development\Powerplay Cubes\cube1.pyh"
Createfiles
savepy "N:\Cognos Development\Powerplay Cubes\cube1.pyh"

Hope this helps,

Adam.
 
Hi Adam,

Could you please tell me how this MDL script can be run in Scheduler. We have an MDL file from which the cube has to be created daily.

Can I use OpenMDL & Create Files staments instead of OpenPy ?

Thanx,
Vinay
 
Hello Team,

As part of our evaluation we want to know how the Role based security is implemented in COGNOS. Is that NT authentication or in the database authentication? Is there any document i can verify about how the roles are assigned?
Please advise.

Thanks,
Ravee
 
Vinay,

To run the mdl script within scheduler, simply select insert recurring task, within the identification tab where you would select a report to be scheduled, drop down the file type box and select all files, insert the mdl file (**the mdl script is just a text document written in notepad, and saved with a file extension of .mdl). The open py part of the mdl statement is a reference to the powerplay report, and is therefore required in the script. Schedule the file as you would a normal report.

Adam.
 
Here is the script that will build the cube daily

You can also add script to move the cubes to the correct destination folders for user access

Remenber, in the model you must fill in the user and password required to access the database (in the Signons window)

option explicit

Sub Main ()
Dim objTransApp As Object
Dim objModel As Object
Dim strModelPath As String
Dim strLocation As String
Dim strModelSource As String
Dim strMsgText As String


'*** Set The Error Trapping *****************************************************

On Error GoTo Errhdlr1:

'*** File Names and Path(s) *****************************************************

strLocation = "C:\Models\PY! Definitions\" ' Set the path to the model
strModelSource = "Sales Analysis.pyi" ' Set the model name
strModelPath = strLocation & strModelSource

'*** Open model inside Transformer **********************************************

Set objTransApp = CreateObject("CognosTransformer.Application.cer1")
Set objModel = objTransApp.OpenModel (strModelPath)

'*** Clean model and build cubes ************************************************

With objModel

.CleanHouse 19981231
.CreateMDCFiles
.Close
End With


Errhdlr1:
Select Case Err
Case 75
strMsgText="Path is invalid."
Case 76
strMsgText="Path not found."
Case 70
strMsgText="Permission denied."
Case Else
strMsgText="Error " & Err & ": " & Error$ & "occurred."
End Select

'*** Display a message about the error that was trapped ************************
MsgBox strMsgText

End Sub
 
Both macros and mdl scripts run in scheduler. We prefer to use mdl scripts due to the simplicity of using a simple paragraph of code in notepad.

Adam.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top