27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

STRING<br />

STRING varlist (An) [/varlist...]<br />

Example<br />

STRING STATE1 (A2).<br />

RECODE STATE (’IO’=’IA’) (ELSE=COPY) INTO STATE1.<br />

Overview<br />

STRING declares new string variables that can be used as target variables in data transformations.<br />

Basic Specification<br />

The basic specification is the name of the new variables and, in parentheses, the variable<br />

format.<br />

<strong>Syntax</strong> Rules<br />

• If keyword TO is used to create multiple string variables, the specified format applies to<br />

each variable named and implied by TO.<br />

• To declare variables with different formats, separate each format group with a slash.<br />

• STRING can be used within an input program to determine the order of string variables<br />

in the dictionary of the working data file. When used for this purpose, STRING must precede<br />

DATA LIST in the input program. See p. 1103 for an example.<br />

• STRING cannot be used to redefine an existing variable.<br />

• String variables cannot have zero length; A0 is an illegal format.<br />

• All implementations of the program allow the A format. Other string formats may be<br />

available on some systems. In addition, the definition of a long string depends on your<br />

operating system. Use keyword LOCAL on the INFO command to obtain documentation<br />

for your operating system.<br />

Operations<br />

• Unlike most transformations, STRING takes effect as soon as it is encountered in the<br />

command sequence. Thus, special attention should be paid to its position among commands.<br />

For more information, see “<strong>Command</strong> Order” on p. 8 in Volume I.<br />

• New string variables are initialized as blanks.<br />

1536

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!