| Date: | Mon, 15 Mar 2010 13:42:27 -0400 |
| Reply-To: | Jonas Bilenas <jonas.bilenas@CHASE.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Jonas Bilenas <jonas.bilenas@CHASE.COM> |
| Subject: | Re: what is the main purpose of informat? |
|---|
An INFORMAT is used to read in data into a SAS dataset. A SAS FORMAT is
used to write out data. There are many built in SAS INFORMATS and FORMATS
and they both work with numeric or character data.
You can also build your own FORMATS and INFORMATS using PROC FORMAT. As an
example of using a numeric INFORMAT, let's assume we have a flat file with
a 3 digit integer field. Missing values are coded up as 999, but you want
to represent those value as missing when reading into SAS. Here is how you
can code up:
PROC FORMAT;
INVALUE miss999x low - 998 = [3.]
999 = .
;
RUN;
DATA TEST;
INFILE flat_file;
INPUT @1 X miss999x.;
RUN;
You can modify the above if you have more than 1 missing code since you can
code up to 27 different missing values.
Jonas Bilenas
On Sat, 13 Mar 2010 05:05:12 -0800, Patrick <patrick.matter@GMX.CH> wrote:
>As Tom said: The main purpose is to convert character to numeric,
|