Overview (STRING command)
STRING declares
new string variables that can be used as target variables in data
transformations.
Basic Specification
The basic specification is the name of the new variables and, in parentheses, the variable format.
Syntax Rules
- If keyword
TOis used to create multiple string variables, the specified format applies to each variable that is named and implied byTO. - To declare variables with different formats, separate each format group with a slash.
-
STRINGcan be used within an input program to determine the order of string variables in the dictionary of the active dataset. When used for this purpose,STRINGmust precedeDATA LISTin the input program. See the examples for theNUMERICcommand. -
STRINGcannot be used to redefine an existing variable. - String variables cannot have zero length;
A0is an illegal format. - All implementations of the program allow the
Aformat. Other string formats may be available on some systems. In addition, the definition of a long string depends on your operating system. Use keywordLOCALon theINFOcommand to obtain documentation for your operating system.
Operations
-
STRINGtakes effect as soon as it is encountered in the command sequence. Therefore, pay special attention to the position ofSTRINGamong commands. See the topic Command Order for more information. - New string variables are initialized as blanks.
- Variables that are declared on
STRINGare added to the active dataset in the order in which they are specified. This order is not changed by the order in which the variables are used in the transformation language. - To change
the defined width of a string variable use the
ALTER TYPEcommand. See the topic ALTER TYPE for more information.