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

automating clean house procedure in transformer

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi,

I'm looking for a way to automate the 'clean house' procedure withing a transformer model. I schedule my cubes using batch files, but in one of the cubes, I use customised views with protection provided by Access Manager.
the problem here is that I have to store my categories within the transformer model and this causes uniqueness violations when something changes within the categories.
Any ideas how to solve this problem?

Thanx
 
I use the following script to do an automatic cleanhouse every night on my cube. In your scheduling program, run the "runmac32.exe" program passing the file containing this script code.

Good Luck.

Bill Quinn



Sub Main()

On Error Resume Next
Kill "d:\cognos\models\DetailOrders.txt"
Kill "d:\temp\Detail Orders.log"

Dim objTransApp As Object
Dim objModel As Object
Dim objDataSource As Object
Dim objCube As Object
Dim objCubeUsers As Object
Dim strDataPath As String
Dim strLocation As String
Dim strDataSource As String
Dim MsgText as String
Dim LastBuildDate as Long

On Error Goto ErrorRtn
strLocation = "d:\cognos"
strModelSource = "\models\Detail Orders.pyi"
strModelPath = strLocation & strModelSource
strMDLSource = "\models\Detail Orders.mdl"
strMDLPath = strLocation & strMDLSource
Set objTransApp = CreateObject("CognosTransformer.application.cer1")
Set objModel = objTransApp.OpenModel(strModelPath,&quot;administrator&quot;,&quot;<Admin Password>&quot;,&quot;Root User Class&quot;)
With objModel
.SaveAs strMDLPath
'$Include: &quot;d:\cognos\models\CleanHouseDetailOrders.txt&quot;

.CreateMDCFiles
.Save
End With

Set objModel = Nothing
Set objTransApp = Nothing


' Save Date of Last Build of this Cube
' Ususally runs after midnight so subtract 1

LastBuildDate = Date - 1

Kill &quot;d:\cognos\models\CleanHouseDetailOrders.txt&quot;
Open &quot;d:\cognos\models\CleanHouseDetailOrders.txt&quot; for Append as #2
MsgText = &quot;.CleanHouse &quot; & Format(LastBuildDate,&quot;yyyymmdd&quot;)
Print #2, MsgText
Close #2

EndIt:
Exit Sub

ErrorRtn:
Open &quot;d:\cognos\models\DetailOrders.txt&quot; for Append as #1
MsgText = &quot;Error &quot; & Err & &quot;: &quot; & Error$ & &quot; occurred at line: &quot; & Erl

Write #1, strModelSource
Write #1, MsgText
Close #1
Resume Next

End Sub
 
guys

I have not tried the code, but i think if u use move check box which is next 2 unique button on the catgery properity in unique level u may not get the uniq probelm

regards
mkram

mkr1975@hotmail.com
He who Conquires the MIND
Conquires the WORLD !!

mkram@usa.net

 
I use a vey low tech solution to this where i have a clean model ie. &quot;clean.pyi&quot; and simply copy it to another filename &quot;build.pyi&quot; prior to building the cube.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top