SAS IT is free
A epoch is coming, no need to write in the client's bulky SAS / AF framework, more popular is to use the browser as the client, and you can do not buy SAS / IntrNet, and even SAS Server There is no need to purchase IT authorization, yes, there is no need, if possible
SAS brought us IT, but its authorization is very expensive, but the COM object group brought by IT is part of SAS Base, which is not requesting IT authorization, so as long as your VB program is running in yours. On the PC and you have SAS8.x on your PC, then the COM library is also introduced, thank you very much, I respect SAS company
Of course, if you want to use DCOM, you must be authorized, otherwise it is illegal, that is, you can only use the COM mode to call the features brought by SAS IT, but this should be sufficient for small and medium-sized applications.
This group of COM libraries can be installed very easily on your machine, you can use any of the two methods below:
1. Install from SAS Client-Side Components CD or the 2nd CD
2, install IT
If you want to use SAS in the SAS in VB, you must also use AppDEV Studio to create a class definition (IDL) for VB usage, of course, if you don't want to be so trouble, you can simply use a macro to achieve the corresponding The function is :)
Ok, look tired, let's play an example, write a small VBA in Word to call SAS
Proceed as follows:
1. Of course, install those related COM libraries, what? You don't know how to install, please write it :)
2, open your word, and set up to allow the macro [Tool / Macro / Security / Select Medium Level Security]
3, open the VBA editor [Tool / Macro / VBA Editor]
4, enter the VBA editor, make sure the following library has been referenced [Tools / Reference]
"Microsoft ActiveX Data Objects 2.5 Library" and
"SAS: Integrated Object Model (IOM) 1.0 Type Library" and
SasworkspaceManager 1.0 Type Library
5. Let us now enter the following code, don't tell me, you don't know how to do it.
DIM OBWS as Sas.Workspace
DIM OBWSM As New SasworkspaceManager.WorkspaceManager
SUB FORM_LOAD ()
Dim Obconn as new adodb.connection
DIM obrs as new adod.com.recordset
Dim Errorstring As String
Rem Start the Sas Session
Set obws = obwsm.workspaces.createworkspaceByserver ("local", _
VisibilityProcess, Nothing, ",", Errorstring)
Rem Submit Some Sas Code
Obws.languageService.Submit_
"DATA A; DO X = 1 to 10; y = 10 * x; Output; end; run;"
Rem Open an ado connection to the data set
DIM Connstring As String
Connstring = "provider = SAS.IOMPROVIDER.1; SAS Workspace ID =" _ Obws.uniqueIndentifier
Obconn.open connString
Obrs.open "Work.a", Obconn, AdopenStatic, AdlockReadonly, _
AdcmdtableDirect
Rem Write the Table As HTML (Visible In Word with tags)
Obrs.movefirst
Dim Stable As String
Stable = "