Date: Tue, 24 Jul 2007 09:17:50 +1000
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David Johnson <d@DKVJ.BIZ>
Subject: Re: help sample
Content-Type: text/plain; charset="iso-8859-1"
The way people use SAS is often changed by the way they regularly interact
with the program. For the person who runs code in a handful of steps and
browses data, there may not be much reason to be concerned over some notes
that appear in the SAS log. After all, each step is being checked in the
interactive process of writing and running SAS code. At least that is a
view held by some people.
On the other hand, you have people who write processes that may run
unattended, or be rerun a number of times to refine a report, or report data
regularly. For the people in that group, every note in the log is
important, and anything outside the expected data set sizing and run time is
a matter for concern. Or at least, it should be, since some of those notes
will affect the data that is delivered.
I pre-empt my remarks with that Vora because I am trying not to make any
comments about "right" and "wrong" ways to write code. However, I think
there is a flaw in your suggestion that could cause you grief and I will
suggest you consider whether that is important to you.
The flaw is that data type conversions are easily done by SAS to clean up
after small oversights in our coding, but if we know the type of our data,
then these should not appear. They are a symptom that we don't fully
understand what we are working with, and they add more "noise" to the log,
which in itself is also potentially a problem.
Knowing that data types will be converted, I would always perform the
conversion explicitly so that the message does not appear, and the data is
handled in the way I expect it to be handled, when it is of the type that I
expect it to be. Then, when a message appears, I know the data are not as I
expected, and I know I need to look further. Refining your solution, I
would code the JOINED line as follows:
JOINED = Put( A, Best.) || B;
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of VORA
Sent: Monday, 23 July 2007 7:24 PM
Subject: Re: help sample
Below is a sample code that you could use. Here I have tried to read "a" as
number. As SAS does implicit numeric to character conversion you would not
have to worry much. It will just put a note in the SAS log stating "Numeric
values have been converted to character values at the places given by ...".
If you read "a" as character then you would not face any problem.
/* reading two columns a and b, a as number and b as character */
input a b $;
/* joining them */
joined = a || b;
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Monday, July 23, 2007 4:48 PM
Subject: help sample
i want join two column in my table sas.
i will obtain a column like this:
thank for your help.