Hi Andy,
I think Jamey is right. You could provide the Job number as a constant at the beginning of your DMS script. However this would need to be done before the job is starting by hand. This is probably not what you want to do.
So you could write a MRS script which reads the Excel file, extracts all needed details from there (i.e. the Job number) and places the according "#define" into a prepared DMS script. Afterwards this MRS script could simply start the DMS job. I've posted an according example from DDL a few days before, but here is the copy of this code snippet:
- Code: Select all
Dim DMOMJob
Set DMOMJob = CreateObject("DMOM.Job")
DMOMJob.Load("C:\Program Files\SPSS Dimensions\DDL\Scripts\Data Management\DMS\MyFirstTransfer.dms", null)
DMOMJob.Run()
You would have to insert a portion of code before the "DMOMJob.Load" that creates the DMS script, i.e. modifes a prepared script by adding some global defines to this script. And of course you need to insert the name of your DMS script!
The thing behind the global variables is that they are bound to the "Job" object. In a DMS job this object only exists in the period from "OnJobStart" until "OnJobEnd". Outside this part the job object does not exist and so you cannot access the global variables for the object.
I hope this helps.
Klaus