[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: automatic type conversion quality: good or bad?
From:       "Moody, Ken () CWS" <Kmoody () HWDC ! STATE ! CA ! US>
Date:       2000-03-31 15:58:01
[Download RAW message or body]

Jim, you ask for certainty and want to be convinced that it always works.  I
can't do that for you.  The topics of automatic conversion from character to
numeric or vice versa are covered in a fair amount of detail in the SAS
documentation.  In Version 6 SAS Language Reference its on pages 102 - 104
and 116.

I won't repeat that material here, but my conclusion is that automatic type
conversions will generally work, will most often work, but may not work.

Why wouldn't an automatic conversion work?  Typically, because the length of
the receiving field is to small, or some related reason.  In such a case an
explicit conversion using PUT() or INPUT() might also fail, but might be
more obvious because the specific format or informat would be apparent in
the function call.

I'm sorry that I can't be more universal in my response, but it now seems
that all of the participants in the thread have wayed in with an opinion
that there's no inherent reason why automatic type conversion won't work,
with the additional caution that messages about automatic conversion should
be investigated to make sure that they reflect design intent and not
accidental misspelling.
 - - - - - - - - - - - - - - - - - - - - - - - - -
Ken Moody
California Health & Human Services Agency Data Center
916-263-1115
kmoody@hwdc.state.ca.us <mailto:kmoody@hwdc.state.ca.us>



-----Original Message-----
From: Jim Groeneveld [mailto:J.Groeneveld@ITGROUPS.COM]
Sent: Friday, March 31, 2000 1:40 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Q: automatic type conversion quality: good or bad?


Hi guys,

Where are you now? I know you are there, Ken Moody, Quentin McMullen,
Patrice Bourdages, Poul Ravn Sørensen and others. Why do you shut up? It
just became interesting. I was following the thread "Convert a string to a
number" and then it died. The subject, about automatic type conversion by
SAS, did not seem to be discussed and answered satisfactory yet IMHO. Some
people objected against it, others didn't. And I don't know. I always apply
explicit type conversion in my macros (I'm doing it my way), but I want to
know the truth about the quality of the automatic implicit type conversion
by SAS. Convince me it always works correctly, or give me at least one
falsifying example of a case in which it doesn't. Reopen the discussion and
I will follow it with a large interest. Say yes and/or no, contradict each
other, keep it vivid. Discuss both conversion from character to numeric type
and vice versa. The outcome may be one or the other, I don't mind, but I
want certainty. I want falsifying and reproducable examples or reassuring
and convincing arguments. I want to hear you, your votes, whether positive
or negative. Tell me, show me, convince me, prove me. I am
unsure!.........[;-(

Regards - Jim.
--
Y. Groeneveld, MSc            IMRO TRAMARKO       tel. +31 412 407 070
senior statistician,          P.O. Box 1          fax. +31 412 407 080
head IT department            5350 AA BERGHEM     IMRO TRAMARKO: a CRO
J.Groeneveld@ITGroups.com     the Netherlands     in clinical research

My computer allows me to be buggy, imperfect; my wife ......

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic