Connect SAS VBA

I tried to run SAS code through VBA. I am running SAS on the server. I have a SAS test program " Program1.sas " that I saved on the server. Below is the VBA code I used. SAS code is running, but the output dataset just shows the column headers and the rows are empty. Can anyone help me for a possible reason.

Sub Form_Load23()
 Dim obObjectFactory As New SASObjectManager.ObjectFactory

 Dim obObjectKeeper As New SASObjectManager.ObjectKeeper

 Dim obServer As New SASObjectManager.ServerDef

 Dim obSAS As SAS.Workspace

 Dim cn As New ADODB.Connection

 Dim rs As New ADODB.Recordset

 obServer.MachineDNSName = "xyz"     

 obServer.Protocol = SASObjectManager.Protocols.ProtocolBridge

 obServer.Port = 8871



 obObjectFactory.LogEnabled = True

 Set obSAS = obObjectFactory.CreateObjectByServer("sas", True, obServer,"userid", "password")


obSAS.LanguageService.Submit ("options source2; %include '/abc/AFP/shikhar.gupta1/amg/**Program1.sas**';")

End Sub'
+4
source share
2 answers

I believe that you should change the security settings in excel. Find security settings and secure browsing. Remove all check marks.

0
source

SAS. , "" . , , options obs=0;.

@vasilij, proc printto, , SMC .

0

Source: https://habr.com/ru/post/1598417/


All Articles