LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2000, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 4 Dec 2000 16:18:02 -0700
Reply-To:   Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject:   Re: Problems with Hex data, please help.
Comments:   To: giuliobelrango@HOME.COM
Content-Type:   text/plain; charset=us-ascii

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_; 2 3 testbyte = 'a2'x; 4 5 ib_in = input(testbyte, ib1.); 6 pib_in = input(testbyte, pib1.); 7 8 put ib_in= pib_in=; 9 10 run;

ib_in=-94 pib_in=162 -----

Use the HEX2. format on output.

-- JackHamilton@FirstHealth.com 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. Example 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.


Back to: Top of message | Previous page | Main SAS-L page