I'm using the following command line:
SUBID_IN_HEX = input(SUBID_IN_HEX,hex.);
If I input as follows:
SUBID_IN_HEX = input('33b',hex.); SUBID_IN_HEX = 827 which is correct. However if I input
SUBID_IN_HEX = input('40b',hex.); SUBID_IN_HEX = 1E3 which should be 1035.
How do I correct the code to ensure no rounding/approximations occur? The digits may go to > 10.
Thanks for your time.
So far, there is not conclusive evidence that any rounding has taken place. You may just need to user a wider format for printing the value of SUBID_IN_HEX. Try printing with:
format SUBID_IN_HEX 4.;
You apparently have assigned a 3 column format to the variable somewhere. Please see:
data junk; v = input('40b',hex.); put 'Fixed 3 column format: ' + 1v= f3. +1 'Best format allowing 6 columns: ' +1v= best6.; run;