With default options, particularly COMPRESS=NO
, SAS will allocate 25 bytes for the character, and pad the unused bytes with spaces ('20'x). That is important not only for storage, but also for character comparisons; while most comparisons ignore trailing spaces, sometimes that's not true and trailing spaces will need to be trimmed explicitly.
However, if you use OPTION COMPRESS=YES
or OPTION COMPRESS=CHAR
, it will compress the field in datasets that are written out such that it acts more like varchar
(it will not take up very much additional space for wasted columns). The spaces are still technically present and may need to be considered in programs, but they do not require a full byte's storage.