$EBCDICw. Format

Converts native format character data to EBCDIC representation.

Category: Character
Alignment: Left

Syntax

$EBCDICw.

Syntax Description

w

specifies the width of the output field.

Default 1
Range 1–32767

Details

If EBCDIC is the native format, no conversion occurs.
On ASCII systems, the $EBCDICw. format is based on the default encoding value of the LOCALE= option that is specified when SAS starts. For example, if the locale was set to en_US locale, the default encoding that is used by the $EBCDICw. format is Open_ed-1047. If the locale is de_DE (German_Germany), the default encoding that is used by the $EBCDICw. format is Open_ed–1141. For a list of locales and encoding values, see Default Values for the ENCODING, DFLANG, DATESTYLE, and PAPERSIZE System Options Based on the LOCALE= System Option in SAS National Language Support (NLS): Reference Guide.
You can specify the translation table that is used to map characters between EBCDIC and ASCII by using the MAPEBCDIC2ASCII system option. For more information, see MAPEBCDIC2ASCII= System Option in SAS National Language Support (NLS): Reference Guide.

Comparisons

  • On ASCII systems, $EBCDICw. converts ASCII character data to EBCDIC.
  • On all other systems, $EBCDICw. behaves like the $CHARw. format.

Example

put name $ebcdic3.;
Value of name
Locale Value Is en_US
Locale Value Is fr_FR
Locale Value Is de_DE
ABC
C1C2C3
C1C2C3
C1C2C3
{ä}
C043D0
514354
43C0DC
[@]
AD7CBD
9044B5
63B5FC
The results are shown as hexadecimal representations of EBCDIC codes for characters. Each two hexadecimal characters correspond to one byte of binary data, and each byte corresponds to one character.