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!

how to script adding datestamp to filename

Status
Not open for further replies.

damzi

Programmer
May 3, 2004
66
US
Hi - I am trying to concatenate the date/time stamp to my log file in cognosscript. Any one here has any idea.
Thanks !
 
Path\Filename " & format$(Date,"yyyy-mm-dd") & ".log")

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Here is what I use to timestamp my cubes.

Sub Main

Dim objTrans as Object
Dim objModel as Object
Dim objCube as Object
Dim strModelName as String
Dim strPath1 as String
Dim strPath2 as String
Dim strModel as String
Dim strCube as String
Dim strCubeName as String
Dim varDate as Variant

'*** File names and path(s) ***
strPath1 = "E:\"
strPath2 = "D:\"
strModelName = "ModelName.mdl"
strCube = "ModelCubeName.mdc"
strModel = strPath1 & strModelName

'*** Finds system date and creates new cube name ***
varDate = CVar(Date)
strCubeName = strModelName & Format(varDate,"Medium Date") & ".mdc"

'*** Open model inside Transformer ***
Set objTrans = CreateObject ("CognosTransformer.application")
Set objModel = objTrans.OpenModel (strModel)
Set objCube = objModel.Cubes.Item(1)

'*** Builds Cube ***
objCube.CreateMDCFile

'*** Renames cube ***
FileCopy strPath1 & strCube, strPath2 & strCubeName

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top