Date: Tue, 8 Jul 1997 19:42:06 EDT
Reply-To: rhoadsm1@WESTATPO.WESTAT.COM
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Mike Rhoads <rhoadsm1@WESTATPO.WESTAT.COM>
Subject: Re: is there an informat for ...
Julie,
The ZD format works as long as you have leading zeroes rather than
leading blanks. I thought that ZDB might allow leading blanks, but wasn't
able to get that to work. See example below.
20 data _null_;
21 input @1 numvar zd4.2 @1 charvar $char4.;
22 put charvar= numvar=;
23 cards;
CHARVAR=242C NUMVAR=24.23
CHARVAR=057K NUMVAR=-5.72
Mike Rhoads
Westat
RhoadsM1@Westat.com
<<original question>>
Dear NG:
I am looking for an informat that will take 242C and return 24.23 or
57K and return -5.72. The last character in the field corresponds to
a numeric value and also to the sign of the entire field.
The following is a translation table
ASCII Value A B C D E F G H I { J K L M N O P Q R }
Sign of Field + + + + + + + + + + - - - - - - - - - -
Last Digit 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
Thanks,
Julie