A variable’s type and width are the type and width of its values (see Values).
enum val_type var_get_type (const struct variable *var) ¶Returns the type of variable var.
int var_get_width (const struct variable *var) ¶Returns the width of variable var.
void var_set_width (struct variable *var, int width) ¶Sets the width of variable var to width. The width of a variable should not normally be changed after the variable is created, so this function is rarely used. This function cannot be applied to a variable that is part of a dictionary.
bool var_is_numeric (const struct variable *var) ¶Returns true if var is a numeric variable, false otherwise.
bool var_is_alpha (const struct variable *var) ¶Returns true if var is an alphanumeric (string) variable, false otherwise.