I am asynchronously submitting SAS code via the COM interface. Since it seems to be documented best, let's use Visual Basic to achieve this: Programming with Visual Basic This documentation is somewhat rudimentary. So if you know a more detailed resource, I'd appreciate it very much to be told about it. Anyway, here is my attempt to asynchronously submit SAS code from Visual Basic: Option Explicit On
Imports SAS
Imports SASObjectManager
Module Program
Private WithEvents ls As LanguageService
Private Sub ls_SubmitComplete(ByVal Sasrc As Long)
System.Console.WriteLine("Completed." + Sasrc)
End Sub
Sub Main(args As String())
Dim factory As New ObjectFactory()
Dim server As New ServerDef()
server.Protocol = 2
server.MachineDNSName = "*** HOSTNAME ***"
server.Port = 8591
Dim workspace As Workspace = factory.CreateObjectByServer("Workspace", True, server, "** USER ***", "*** PASSWORD ***")
ls = workspace.LanguageService
ls.Async = True
ls.Submit("%put Test;")
System.Threading.Thread.Sleep(10000)
End Sub
End Module Here, I tried to adapt the approach described in Receiving events and the more detailed but outdated LanguageService Object. The problem is that, even though the submit completes successfully, ls_SubmitComplete is never called, i.e. the message "Completed." won't appear. Could anyone help me how to properly receive and handle such events?
... View more