Examples (STRING command)

STRING STATE1 (A2).
RECODE STATE ('IO'='IA') (ELSE=COPY) INTO STATE1.
  • STRING declares variable STATE1 with an A2 format.
  • RECODE specifies STATE as the source variable and specifies STATE1 as the target variable. The original value IO is recoded to IA. Keywords ELSE and COPY copy all other state codes unchanged. Thus, STATE and STATE1 are identical except for cases with the original value IO.
    STRING V1 TO V6 (A8) / V7 V10 (A16).
  • STRING declares variables V1, V2, V3, V4, V5, and V6, each with an A8 format, and variables V7 and V10, each with an A16 format.