<< Click to Display Table of Contents >> Navigation: User guide > Variables > $svar |
The term svar represents a single-valued variable name of up to 30 characters which is always preceded by a dollar sign. Svars can hold up to 30000 responses (bits) of information. Only one response can be true in an svar at any time. This will usually be the first response found in a string definition or the value derived from a matrix definition. If a response is forced true with a M (make) command, then all other responses are automatically set false. The length of an svar is determined on the first definition.
Unlike mvars, a svar can be used in arithmetic, it has a value equivalent to the response which is true. If all responses are false the value of the svar is zero.
Svars are normally given a value with a D (define) command. The following examples define svars:
ds $sex=$110/1,2,
ds $area=$123/1-4,
The variable $SEX has two responses and $AREA has 4 responses. The D (define) statements are executed and the values copied from the data locations to the variables when the definitions are reached.