$HEXw. Informat

Converts hexadecimal data to character data.
Category: Character
See: $HEXw. Informat: UNIX in SAS Companion for UNIX Environments

$HEXw. Informat: Windows in SAS Companion for Windows

Syntax

$HEXw.

Syntax Description

w
specifies the number of digits of hexadecimal data.
If w=1, $HEXw. pads a trailing hexadecimal 0. If w is an odd number that is greater than 1, then $HEXw. reads w–1 hexadecimal characters.
Default:2
Range:1–32767

Details

The $HEXw. informat converts every two digits of hexadecimal data into one byte of character data. Use $HEXw. to encode hexadecimal values into a character variable when your input method is limited to printable characters.

Comparisons

The HEXw. informat reads two digits of hexadecimal data at a time and converts them into one byte of numeric data.

Example

input @1 name $hex4.;
Data Line
Result
----+----1
ASCII
EBCDIC
6C6C
ll
%%