Hi, I'm using EG automation via a VBScript to batch submit SAS programs from a thrid party editor. Interactively, SAS EG will set the _SASPROGRAMFILE macro variable to be the fully qualified path and file name of the SAS program running, but EG automation does not set this. I'm using EG 7.13 HF4 and SAS 9.4. My VBScript, via file system and file streaming objects, reads in the text from the SAS program, assigns to the Code.Text property and runs. See below. It all works fine except I cannot assign librefs, etc. using part of the program path without hard-coding the path in the text of the batch submitted program. Thanks, MM Dim fileSys, fReadStream, fileString Set fileSys = CreateObject("Scripting.FileSystemObject") Set fReadStream = fileSys.OpenTextFile(sasPgmFile, 1, False) fileString = fReadStream.ReadAll() ' add the new code object to the project Set sasPgmObj = EGPrjObj.CodeCollection.Add ' set the results types, overriding Application defaults sasPgmObj.UseApplicationOptions = False sasPgmObj.GenListing = True sasPgmObj.GenSasReport = False ' Set the server and text for the code sasPgmObj.Server = sasServer sasPgmObj.Text = fileString sasPgmObj.Run ' Run the code
... View more