BookmarkSubscribeRSS Feed
Dreamer
Obsidian | Level 7

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 Smiley Sad

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

2 REPLIES 2
ballardw
Super User

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?

Dreamer
Obsidian | Level 7

Hi ,

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.

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 970 views
  • 0 likes
  • 2 in conversation