Search notes:

SAS Enterprise Guide: Scripting

aka: Enterprise Guide Automation
option explicit

dim app
dim project
dim sasProgram
dim i

Set app = createObject("SASEGObjectModel.Application.7.1")

app.SetActiveProfile("tq84-Server")

set project = app.new 
set sasProgram = project.CodeCollection.Add
 
' set the results types, overriding app defaults
sasProgram.UseApplicationOptions = false
sasProgram.genListing            = true
sasProgram.genSasReport          = false
 
sasProgram.server = "SASApp"
sasProgram.text   = "proc means data=sashelp.cars; run;"
 
sasProgram.run
sasProgram.log.saveAs "c:\temp\outputAuto.log"
 
for i=0 to (sasProgram.results.count -1)

 ' Listing type is 7
   if sasProgram.results.item(i).type = 7 then
 ' Save the listing file to LOCAL disk
     sasProgram.results.item(i).saveAs "c:\temp\outputAuto.lst"
   end if
next

app.quit
Compare http://blogs.sas.com/content/sasdummy/2011/05/03/using-sas-enterprise-guide-to-run-programs-in-batch/

Registering the automation dll

In order to run the example, the automation object must be registered:
c:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase "c:\Program Files\SASHome\SASEnterpriseGuide\7.1\sasegscripting.dll"

TODO

Batch processing under Windows.

See also

Power shell example
Creating Visual Basic for Application Code

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Companie...', 1740080413, '3.15.181.250', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Companies-Products/SAS/Enterprise-Guide/Scripting/index(89): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78