SASCodeRunner7 Visual Basic Form Sample

Run SAS code when a Visual Basic form's button is clicked. The run_report.sas program depends on a macro variable called report_month. Another thing that this sample does is permanently save the log and lst files using Proc Printto.

Private Sub Command1_Click()
  Dim S As New SASCodeRunner7.CodeRunner
  S.SASCode = "%let report_month=July;"
  S.SASCode = "proc printto log='c:\my_programs\run_report.log' "
  S.SASCode = "             print='c:\my_programs\run_report.lst';"
  S.SASCode = "run;"
  S.SASCode = "c:\my_programs\run_report.sas"
  Dim ret As String
  ret = S.Execute
  MsgBox "Return value: " & ret, vbInformation, "SAS has finished executing"
  MsgBox S.SASCode, vbInformation, "What SAS code did I just run?"
  Set S = Nothing
End Sub

SASCodeRunner7 was produced in 2002 by David Rubanowice, Group Health Cooperative, Seattle, WA

Hosted by www.Geocities.ws

1