[Recommended] SAS IT is free !!!

xiaoxiao2021-03-06  14

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 = "

"

Selection.Typetext Stable

Stable = obrs.getstring (, "

", _

"

")

Selection.Typetext Stable

Stable = " "

Selection.Typetext Stable

Rem Tidy-Up

Obrs.close

Obconn.close

Obws.close

End Sub

6, the code is written, of course it is running

7, is it run? You go to the Word interface to see, what happened? Oh, of course, there may be problems in your environment, but I have indeed seen anything in me.

Ok, the article is over, I hope everyone likes it. Of course, I hope that everyone does not misunderstand the title, SAS IT is not free, but some COM objects brought by this product are free.

转载请注明原文地址:https://www.9cbs.com/read-67590.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.060, SQL: 9