The
ValueSet statement creates a dynamic
value set with the name
valueset_name. The ValueSet name must be unique and must contain only letters, numbers, or the underscore character. The name must begin with a letter. You can declare ValueSet objects globally in
PROC GLOBAL or locally in functions or procedures.
ValueSet objects can be
numeric or
string. By default a value set is numeric, but the type can be modified by specifying the
valueset_type. When associating a value set with an item using
setvalueset, the type must match the item type (numeric for numeric items, and string for alphanumeric items).
The following variable modifiers apply to ValueSet objects:
- persistent: to persist the variable's value from one run of an application to another.
PROC MENU
onfocus
ValueSet menu_valueset;
// interviewer options
if USER_ROLE = 1 then
menu_valueset.add("Add New Household", 1);
menu_valueset.add("View Existing Households", 2);
// supervisor options
else
menu_valueset.add("View Household Report", 3);
endif;
menu_valueset.add("Quit", 99);
setvalueset(MENU, menu_valueset);