10-02-2012 06:32 AM
I'm have just started using EG 4.3 on Windows 7 to run about 250 jobs in batch via a remote server every night.I would like to direct the logs from these jobs to a central folder for further log scanning analysis. I'm thinking that I need to add some code to my VBScripts in order each project to direct the log to my predefined folder.Does anyone have a suggestion as to what I need to add to be below stated VBScript in order for this to succesfully happen?
'shut down the app
If not (app Is Nothing) Then
Set app = Nothing
On Error Resume Next
' Start up Enterprise Guide using the project name
prjName = "C:\_Services\Scheduling\finance.egp" 'Project Name
Set app = CreateObject("SASEGObjectModel.Application.4.3")
If Checkerror("CreateObject") = True Then
' open the project
Set prjObject = app.Open(prjName,"")
If Checkerror("app.Open") = True Then
' run the project
If Checkerror("Project.run") = True Then
' Save the new project
If Checkerror("Project.Save") = True Then
' Close the project
If Checkerror("Project.Close") = True Then
Checkerror = False
If Err.Number <> 0 Then
strmsg = "Error #" & Hex(Err.Number) & vbCrLf & "In Function " & fnName & vbCrLf & Err.Description
'MsgBox strmsg 'Uncomment this line if you want to be notified via MessageBox of Errors in the script.
Checkerror = True
10-02-2012 08:08 AM
You can add a bit of script that will iterate through and export each SAS log that is produced in the project.
For background information, see:
with more examples from this sasCommunity.org page:
And specifically, this example:
07-09-2013 03:34 AM
I saw the script ExtractCodeAndLog.vbs and found very useful. Now if I want to email the log file if there is an error in the code, how should I make the change?
10-02-2012 08:35 AM
As a general and possibly not welcome comment:
If this is about 250 jobs then scheduling using EG is may be the wrong approach as it needs a client computer with EG running. There is commercial scheduling software like LSF on the market which should be used. EG scheduling is imho only appropriate for some small scale scheduling tasks in a more "informal" environment. 250 jobs clearly exceed such a definition.
10-02-2012 08:48 AM
I agree with Patrick's sentiment on scalability.
However, I know that there are sometimes competing factors, including the ability to engage IT in the activity. With EG automation you can achieve some of the benefits of scheduling (including auditing logs) if you write your scripts correctly.
At some point you may outgrow that approach, or your IT organization may want to "operationalize" the process differently.