LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 22 Jun 2000 17:12:36 GMT
Reply-To:     "John M. Wildenthal" <jmwildenthal@MY-DEJA.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "John M. Wildenthal" <jmwildenthal@MY-DEJA.COM>
Organization: Deja.com - Before you buy.
Subject:      Re: Combining using !! always turns in character results? version
              8 for Windows

In article <961654321.3259@ns0.klm.nl>, "F a b r i z i o" <Fabrizio1@usa.net> wrote: > paula wrote in message ... > >I know if I have Var1 as a character variable and v2 as a numeric, and I do > > > >v3 = var1 !!v2; > > > >I should expect V3 to be of character type, although Var1 may only carry > >numbers. > > > >Now my case is: I am "declaring" V3 here for the first time; var1 and v2 > are > >both preexisting numeric field; no trash, no missing whatsoever. I still > >have v3 changed into character type. Should I expect V3 to be numeric at > >all? what seems to be the rationale here? > > As soon as you use a variable for the first time, and perform > a character-operation on it (like '!!'), the result will be character. > > Only if SAS cannot determine what happens with a variable, or > if it detects only numeric operations, the resulting variable will > be declared as numeric. > > If your intention of "V3=V1!!V2" is to yield a numeric result, > you should use V3=V1 * 10 + V2 (or something like that).

Only one thing I can think of adding. Try

v3 = INPUT(v1||v2,best12.);

instead.

Sent via Deja.com http://www.deja.com/ Before you buy.


Back to: Top of message | Previous page | Main SAS-L page