Preventing Transcoding Issues

When you work with character data in a different encoding than the SAS session encoding, some characters might cause transcoding failures. Very often this is indicated in the log with errors similar to this:

ERROR: Unable to transcode data, status=0x808FE808.

To avoid transcode failures, you can use the SAS_ACCESS_SUBCHAR= environment variable. Use this environment variable to specify the character to substitute for characters that cannot be transcoded into the SAS session encoding. You can set this variable to the same values as the SUBCHAR= LIBNAME option that is used by other data sources: QUESTIONMARK (use a '?'), SPACE (use a space), SUB (use the default substitution character for the target encoding), or UESC (use the '\uddd' value). For more information, see SUB_CHAR= LIBNAME Statement Option.

Use the SET system option in the OPTIONS statement to set the SAS_ACCESS_SUBCHAR= environment variable.

options set=sas_access_subchar='SPACE';

To see details about the rows and columns that are affected by transcoding errors, specify the SASTRACE= option:

options sastrace=',,,d';
Last updated: February 3, 2026