Calling SAS Procedures |
Recall from Chapter 1, "Introduction," that the DataObject, which coordinates all of the dynamically linked graphics and tables, runs on the client and keeps its data in memory on the client. SAS procedures, however, 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 Graphics," 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.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.