DataObject.AddVars

Prototypes

void AddVars( Matrix mVarNames <, Matrix mVarLabels>, Matrix mValues <, boolean bNominal> )

void AddVars( Matrix mVarNames, Matrix mVarLabels, Matrix mValues, Matrix mNominal )

Parameters

Matrix mVarNames
A vector that specifies the names to assign to the variables in the DataObject. The string mVarNames[i] specifies the name of the variable whose initial data comes from mValues[,i]. Each string must be a valid SAS variable name.

Matrix mVarLabels
A vector that specifies the labels to assign to the variables in the DataObject. A variable's label describes the variable. The string mVarLabels[i] specifies the label of the variable whose name is mVarNames[i]. If the mVarLabels parameter is not specified, each variable is assigned a label that is the same as its name.

Matrix mValues
A matrix that contains the variables' initial data. The column vector mValues[,i] contains the data for the variable whose name is mVarNames[i].

boolean bNominal
If mValues contains exclusively nominal data, set bNominal to true. If mData contains exclusively interval data, set bNominal to false.

Matrix mNominal
A vector that specifies whether each column in mValues contains interval or nominal data. Set mNominal[i] to zero if the column vector mValues[,i] contains interval data. Set mNominal[i] to a nonzero value if the column vector mValues[,i] contains nominal data.

Remarks

This method adds one or more variables to the DataObject. If neither bNominal nor mNominal is specified, mValues is assumed to contain exclusively interval data.

Example
declare DataObject dobj;
dobj = DataObject.Create( "Sample Data" );
mData = { 20 165,
          30 170,
          40 175,
          50 180,
          60 170,
          70 160 };
mVarNames = { "Age", "Weight" };
dobj.AddVars( mVarNames, mData );
DataTable.Create( dobj ).ActivateWindow();
See Also

DataObject.AddAnalysisVar
DataObject.AddAnalysisVars
DataObject.AddVar