Date: Tue, 10 Dec 2002 14:34:17 -0500
Reply-To: Marianne Whitlock <WHITLOM1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Marianne Whitlock <WHITLOM1@WESTAT.COM>
Subject: Re: recruiting cheesy, sleasy SAS tricks
Content-Type: text/plain; charset="iso-8859-1"
I didn't see the earlier thread, but the ATTRIB statement change the length
in the code below:
data a;
CharVar = "XYZ" ;
run;
proc sql ;
select length
from dictionary.columns
where libname="WORK"
and upcase(memname) = "A"
and upcase(name) = "CHARVAR"
;
quit;
data b;
attrib CharVar length= $ 4;
set a;
CharVar = "ABCD" ;
run;
proc sql ;
select length
from dictionary.columns
where libname="WORK"
and upcase(memname) = "B"
and upcase(name) = "CHARVAR"
;
quit;
-----Original Message-----
From: Michael L. Davis [mailto:michael@BASSETTCONSULTING.COM]
Sent: Tuesday, December 10, 2002 1:56 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: recruiting cheesy, sleasy SAS tricks
BTW, thanks to all for the help last week with regards to reordering the
PDV. Unfortunately, the friend for whom I was trolling wanted as easy a
method as the RETAIN statement. The ATTRIB statement was to change the
length of a variable brought in by a SET statement. So combining the RETAIN
and ATTRIB statements did not work (the length was not changed by the ATTRIB
statement).
|