Working with SAS Data Sets


Using Data Set Options

The SAS/IML USE, EDIT, and CREATE statements support most of the standard SAS data set options, as documented in SAS Data Set Options: Reference. For example, the following statements use the OBS=, RENAME=, and DROP= data set options to read data from the Sashelp.Class data set:

proc iml;
use sashelp.class(obs=5
      rename=(sex=Gender)
      drop=Age);
read all var _NUM_ into X[colname=nNames];
read all var _CHAR_ into C[colname=cNames];
close sashelp.class;
print X[c=NNames] C[c=cNames];