Calling SAS Procedures


Create a Data Set for the Procedure

Recall from ChapterĀ 1: Introduction to SAS/IML Studio, that the DataObject, which coordinates all of the dynamically linked graphs and tables, runs on the client and keeps its data in memory on the client. However, SAS procedures run on the SAS server and read data from a SAS data set in a library. Therefore, to perform an analysis, you must get data out of the DataObject and write the data to a SAS data set in a server library.

In ChapterĀ 3: Creating Dynamically Linked Graphs, you created a scatter plot of wind_kts versus min_pressure for the Hurricanes data. You might have noticed that the scatter plot reveals a linear relationship between these two variables. In this section you call the REG procedure to fit a linear least squares model.

Type or copy the following statements into a program window.

   declare DataObject dobj;
   dobj = DataObject.CreateFromFile("Hurricanes");

   dobj.WriteVarsToServerDataSet( {"wind_kts" "min_pressure"},
        "Work", "Hurr", true );

These statements create a DataObject from the Hurricanes data set on your PC and write the wind_kts and min_pressure variables to a server data set called Work.Hurr. These statements are explained in ChapterĀ 2: Reading and Writing Data.

Note: If your data are already in a data library on the SAS server (for example, Sasuser), then the previous statements are not necessary. You can just reference the data set in the DATA= option of the procedure.