Dear visitor, welcome to Palo Community Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Date of registration: Feb 21st 2007
Location: Lytham UK
Occupation: OLAP consultant specialising in retail
Date of registration: Jul 13th 2009
Location: Vienna / Austria
Occupation: Senior Consultant @ Vector SW DV GmbH
by using a VBA friendly soap client
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
Sub RunETLJob(sProject As String, Optional sJob As String, Optional sParamaters As String, Optional bCreateLogFile As Boolean, Optional bShowLog As Boolean)
Debug.Print
sCurrentUser = 'set user name
sDateTime = Format(Now, "yyyymmdd_hhMM")
sETLServer = 'set ETL server name, f.e. sETLServer=server
sETLClient = 'set ETL client path, f.e. sETLClient="c:\Program Files\Jedox\Palo Suite\tomcat\client"
sETLLogFile = 'set output path for log file, f.e. sETLClient="c:\"
sETLBatFile = 'set output path for bat file, f.e. sETLClient="c:\"
sETLCommand = "etlclient -s " & sETLServer & " -p " & sProject & IIf(sJob <> "", " -j " & sJob, "") & IIf(sParamaters <> "", " -c " & sParamaters, "") & IIf(bCreateLogFile, " 1> """ & sETLLogFile & """", "")
Open sETLBatFile For Output As #1
Print #1, "CD /D " & sETLClient
Print #1, sETLCommand
Print #1, "EXIT"
Close #1
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & sETLServer & "\root\cimv2")
Set objProcess = objWMIService.Get("Win32_Process")
errReturn = objProcess.Create(sETLBatFile, Null, Null, intProcessID)
If errReturn = 0 Then
Do While Not Len(Dir$(sETLLogFile & Replace(Replace(Replace(sDateTime & "_" & sCurrentUser & "_" & sProject & IIf(sJob <> "", "_" & sJob, "") & IIf(sParamaters <> "", "_" & sParamaters, ""), " ", "_"), "=", "-"), ".", "") & ".log")) > 0
Loop
Do While Not FileLen(sETLLogFile & Replace(Replace(Replace(sDateTime & "_" & sCurrentUser & "_" & sProject & IIf(sJob <> "", "_" & sJob, "") & IIf(sParamaters <> "", "_" & sParamaters, ""), " ", "_"), "=", "-"), ".", "") & ".log") > 0
Loop
Application.Wait (Now + TimeValue("0:00:02"))
If bShowLog Then Shell "NOTEPAD.EXE " & sETLLogFile & Replace(Replace(Replace(sDateTime & "_" & sCurrentUser & "_" & sProject & IIf(sJob <> "", "_" & sJob, "") & IIf(sParamaters <> "", "_" & sParamaters, ""), " ", "_"), "=", "-"), ".", "") & ".log", vbNormalFocus
Else
MsgBox "Import could not be started on computer " & sETLServer & " due to error: " & errReturn
End If
Kill sETLBatFile
End Sub
Sub test()
RunETLJob "importBiker", , , True, True
End Sub
|
Date of registration: Jul 13th 2009
Location: Vienna / Austria
Occupation: Senior Consultant @ Vector SW DV GmbH