Converts packed hexadecimal data to character data.
-
w
-
specifies the number of bytes in the input.
When you use $PHEXw. to
read packed hexadecimal data, the length of the variable is the number of
bytes that are required to store the resulting character value, not w. In general, a character variable whose length is implicitly
defined with $PHEXw. has a length of 2w-1.
Default: |
2 |
Range: |
1-32767 |
Packed hexadecimal data are like packed
decimal data, except that all hexadecimal characters are valid. In packed
hexadecimal data, the value of the low-order nibble has no meaning. In packed
decimal data, the value of the low-order nibble indicates the sign of the
numeric value that the data represent. The $PHEXw.
informat returns a character value and treats the value of the sign nibble
as if it were X'F', regardless of its actual
value.
The
PDw.d. informat reads packed decimal data and converts them to
numeric data.
input @1 devaddr $phex2.;
Data Line* |
Results |
0001111000001111
|
1E0
|
*The data line represents two bytes of actual binary data, with each
half byte corresponding to a single hexadecimal digit. The equivalent hexadecimal
representation for the data line is 1E0F.
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.