You have to tell SAS whether to use the first bit as
part of the value or as a sign flag. Since you want
use it as part of the value, you should use the PIB.
informat rather than the IB. informat when reading
in the value.
1 data _null_;
3 testbyte = 'a2'x;
5 ib_in = input(testbyte, ib1.);
6 pib_in = input(testbyte, pib1.);
8 put ib_in= pib_in=;
Use the HEX2. format on output.
Development Manager, Technical Group
METRICS Department, First Health
West Sacramento, California USA
>>> Giulio Belrango <giuliobelrango@HOME.COM> 12/04/2000 2:37 PM >>>
I'm working in an IBM mainframe (OS/390) environment. I have a record layout
with hex fields. I want to display them in both, decimal and hexadecimal.
A one character field (FieldA) contains the value 'A2', this is how it is
stored on the file. The value 'A' is in the upper part of the byte and value
'2' in the lower part of the byte. 'A2' is a non printable character.
'A2' is 162 in decimal. I want to print it as A2 and 162.
I used @?? Fielda IB1. this displays the value as -94 which is incorrect. I
also used $HEX1. with no results.
Any help or comments appreciated.