Date: Fri, 12 Jul 2002 11:21:10 -0400
Reply-To: Howard_Schreier@ITA.DOC.GOV
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard_Schreier@ITA.DOC.GOV
Subject: Re: A little problem about "Space delimited" file
The INPUT statement usually maps single dots (periods) to blanks (spaces).
This is arbitrary rather than logical behavior, though there are sound
reasons for it. You can avoid it by using the $CHAR informat.
If you merely want to display dots instead of blanks which were stored,
create a format like
proc format; value $dot ' '='.'; run;
then apply that format to variables for which it is appropriate.
Background --
SAS does not really provide for either missing or null values for character
variables. By convention, blanks are considered to represent missing values.
The special behavior of the INPUT statement in response to single-dot fields
in a way has nothing to do with space-delimited data, in that it occurs with
(for example) column style input. But in another way, it has everything to
do with space-delimited data in that it was probably motivated by the desire
to make space-delimited list style input behave by default the way most
people most of the time want it to behave.
On Fri, 12 Jul 2002 13:36:44 +0800, YCF <yiu628fan@YAHOO.COM.HK> wrote:
>Hi all,
> I have a "space delimited" data file (filename: testing.prn) like this:
>d_no. Name Status Code Company name
>1 John Chan Y . ABC Ltd.
>1 Peter Wong . 2 .
>1 Ann Lee . 1 .
>
>I use 'infile' and 'input' to read the data. However, the "proc print"
>output is like this:
>
>d_no. Name Status Code Company name
>1 John Chan Y . ABC Ltd.
>1 Peter Wong 2
>1 Ann Lee 1
>
>There is no ' . ' but just a blank to denote the missing value of a
>Character variable. Are there any methods such that ' . ' can be printed
out
>to denote the missing value? Thanks very much!!
>
>YCF