DataObject.GetVarCharacteristics

Prototypes

void GetVarCharacteristics( <Matrix mVarNames,> Matrix mVarCharacteristics )

void GetVarCharacteristics( <String sVarName,> Matrix mVarCharacteristics )

void GetVarCharacteristics( <String[] asVarNames,> Matrix mVarCharacteristics )

Parameters

Matrix mVarNames
A vector containing the names of the variables whose characteristics you want to retrieve.

String sVarName
The name of the variable whose characteristics you want to retrieve.

String[] asVarNames
The names of the variables whose characteristics you want to retrieve.

Matrix mVarCharacteristics
Upon return, contains a numeric column vector in which element i contains the characteristic flags for specified variable i. See Remarks for information about the flags.

Remarks

This method retrieves the characteristics of variables in the DataObject. If you call this method with only the parameter mVarCharacteristics, the method retrieves the characteristics of all the variables in the DataObject.

The characteristic flags are as follows:

VC_NUMERIC
Indicates the variable is a numeric variable.

VC_CHARACTER
Indicates the variable is a character variable.

VC_INTERVAL
Indicates the measurement level of the variable is Interval.

VC_NOMINAL
Indicates the measurement level of the variable is Nominal.

VC_SELECTED
Indicates the variable is selected.

Example
declare DataObject dobj;
dobj = DataObject.CreateFromFile( "Baseball" );
dobj.GetVarCharacteristics( m );
do i = 1 to nrow(m);
    name = dobj.GetVarName( i );
    /* band function returns Bitwise AND */
    if band( m[i], VC_NUMERIC ) then
        type = "numeric";
    if band( m[i], VC_CHARACTER ) then
        type = "character";
    print ("Variable '" + name + "' is " + type);
end;