![]() Chapter Contents |
![]() Previous |
![]() Next |
| $CHARw. |
| Category: | Character |
| Syntax | |
| Syntax Description | |
| Details | |
| Comparisons | |
| Examples |
Syntax |
| $CHARw. |
| Default: | 8 if the length of the variable is undefined; otherwise, the length of the variable |
| Range: | 1-32767 |
| Details |
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.
| Comparisons |
| Language | Character Notation |
|---|---|
| SAS | $CHAR8. |
| IBM 370 assembler | CL8 |
| C | char [8] |
| COBOL | PIC x(8) |
| FORTRAN | A8 |
| PL/I | CHAR(8) |
| Examples |
input @1 name $char5.;
| Data Lines | Results* |
|---|---|
----+----1 |
|
XYZ |
XYZ## |
XYZ |
#XYZ# |
. |
##.## |
X YZ |
#X#YZ |
| *The character # represents a blank space. | |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.