<< Click to Display Table of Contents >> Navigation: Reference > Commands > Data look up definitions |
A data look up definition command takes one of the forms:
DI ivar = variable(iconstant1 , iconstant2 ...),
DW wvar = variable(wconstant1 ,wconstant2 ...),
Variable may be an svar or an mvar.
The number of constants specified must be equal to the length of the variable.
The ivar or wvar is assigned a value from the list where the value of the variable is used to determine which one to use. If the variable is 1 (bit 1 true), the wvar or ivar is set equal to the first constant, value 2 to second constant, and so on. If the variable is empty (value 0), then the wvar or ivar is set to undefined (U).
This definition type is often used to create an wvar with the analysis values (label control <V>) from rating scales.
If the variable is an mvar then the first true bit is used to determine the constant. If the value assigned to the first true bit is U then this bit is ignored and CL uses the second true bit, and so on.
Examples of data look up definition commands:
di $val=$score(7,6,5,4,3,2,1,u),
dw $wload=$msum(u,1.5,2.5,u,4.5,7.5,u),