Hi,
I am writing a VB script to run a SAS code. It works perfectly.
It runs the SAS code and saves log at requried location.
But I'm not able to save the SAS list. I tried various options but no luck
Below is a part of VB Script that I'm using:
----------------------------------------------------------------------------------------------------------
Set app = CreateObject("SASEGObjectModel.Application.6.1")
If Checkerror("CreateObject") = True Then
Exit Sub
End If
' open the project
Set prjObject = app.New()
If Checkerror("app.New") = True Then
Exit Sub
End If
' open the file and put the text into the fileString variable
Dim fileSys, fReadStream, fileString
Set fileSys = CreateObject("Scripting.FileSystemObject")
Set fReadStream = fileSys.OpenTextFile(codeFile,1, False)
fileString = fReadStream.ReadAll()
' add the new code object to the project
Set codeObj = prjObject.CodeCollection.Add
' Set the server and text for the code
codeObj.Server = codeServer
codeObj.Text = fileString
codeObj.Run ' Run the code
codeObj.Log.SaveAs logFile ' Save the log filelist
Default for SAS 9.3 and later is to not create listing output so version may be important. And possibly how you call SAS as options such as -Print can affect output locations or even if created. Does the log for these jobs show any info about output?
I'm using SAS 9.4.
There is one option "Proc Print" but I don't want to modify the SAS code. Because there are a lot of them and also I'm not the developer for most of them.
I can use -print option when I execute a SAS code from command line. But I have some EGP files as well and I don't think I can call them from command line.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.