Reads character data with blanks.
-
w
-
specifies the width of the input field.
Default: |
8 if the length of the
variable is undefined. Otherwise, the default is the length of the variable |
Range: |
1-32767 |
The $CHARw.
informat does not trim leading and trailing blanks or convert a single period
in the input data field to a blank before storing values. If you use $CHARw. in an INFORMAT or ATTRIB statement within a DATA step to
read list input, then by default SAS interprets any blank embedded within
data as a field delimiter, including leading blanks.
-
The $CHARw. informat
is almost identical to the $w. informat. However
$CHARw. does not trim leading blanks or convert
a single period in the input data field to a blank, while the $w. informat does.
-
Use the table below to compare the SAS informat
$CHAR8. with notation in other programming languages:
Language |
Character Notation |
SAS |
$CHAR8. |
IBM 370 assembler |
CL8 |
C |
char [8] |
COBOL |
PIC x(8) |
Fortran |
A8 |
PL/I |
CHAR(8) |
input @1 name $char5.;
Data Line |
Results* |
----+----1
|
|
XYZ
|
XYZ##
|
XYZ
|
#XYZ#
|
.
|
##.##
|
X YZ
|
#X#YZ
|
*
The character # represents a blank space. |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.