SAS and VBA (8): What VBA can do for SAS?

The eventual answer is user interface (I really don’t mean SAS/AF) with or without Excel.

In the Windows environment, SAS provides data access layer by ADO and ADO.NET. We can build the applications using SAS at the backend through ADO.NET. Since Visual Basic.NET has the similar syntax to VBA, if somebody is comfortable to code in Microsoft’s Visual Studio, then developing a desktop app is always feasible although it requires quite a few efforts.

For example, let’s run a simple linear regression using the variable of WEIGHT to predict HEIGHT based on the SASHELP.CLASS data set. We can use Excel’s macro to fetch the output by SAS as a new result sheet in the same workbook. Similarly, a desktop application (.exe) will run SAS as batch mode without notice and return the regression result in a browser. The best part of developing such an application is that Excel or Visual Studio comes at nearly no cost. And as you know, the client doesn’t need to know anything about SAS.

The UI in Excel

After hitting the button

The UI of a desktop app

After hitting the button