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 (May 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 20 May 2010 09:43:55 -0400
Reply-To:   that statsguy <thatstatsguy@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   that statsguy <thatstatsguy@GMAIL.COM>
Subject:   Concatenating 2 numerics
Content-Type:   text/plain; charset=ISO-8859-1

This is a question more out of curiosity than necessity, but if I use the || operator on 2 numeric variables, I get a character variable of length 24. Where does the 24 come from?

data test; input var1 var2 $ var3; cards; 1 a 10 2 a 9 3 b 8 4 b 7 4 c 6 4 c 5 4 c 4 ; run;

data test; set test; var4=var1||var3; var5=cats(var1,var3); run;

proc contents data=test; run;

Alphabetic List of Variables and Attributes # Variable Type Len 1 var1 Num 8 2 var2 Char 8 3 var3 Num 8 4 var4 Char 24 5 var5 Char 200

var5 has a length of 200, which is what I expected, but var4 has a length of 24.


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