A Format (Standard Characters)
The A
format is used to read standard characters.
Characters can include letters, numbers, punctuation marks, blanks,
and most other characters on your keyboard. Numbers entered as values
for string variables cannot be used in calculations unless you convert
them to numeric format with the NUMBER
function.
See the topic String/numeric conversion functions for more information.
Fixed data:
With fixed-format input data, any punctuation—including leading, trailing, and embedded blanks—within the column specifications is included in the string value. For example, a string value of
Mr. Ed
(with one embedded blank) is distinguished from a value of
Mr. Ed
(with two embedded blanks). It is also distinguished from a string value of
MR. ED
(all upper case), and all three are treated as separate values. These can be important considerations for any procedures, transformations, or data selection commands involving string variables. Consider the following example:
DATA LIST FIXED /ALPHAVAR 1-10 (A).
BEGIN DATA
Mr. Ed
Mr. Ed
MR. ED
Mr. Ed
Mr. Ed
END DATA.
AUTORECODE ALPHAVAR /INTO NUMVAR.
LIST.
AUTORECODE
recodes the values into consecutive
integers. The following figure shows the recoded values.
ALPHAVAR NUMVAR
Mr. Ed 4
Mr. Ed 4
MR. ED 2
Mr. Ed 3
Mr. Ed 1