Date: Tue, 8 Jan 2002 09:26:28 -0500
Reply-To: don.henderson@US.PWCGLOBAL.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Don Henderson <don.henderson@US.PWCGLOBAL.COM>
Subject: Re: transfer/copy variable labels from one dataset to another?
Content-type: text/plain; charset=us-ascii
A comparable technique, but one that does not read any of the records from
data set a is:
data b;
if 0 then set a;
set b;
run;
The "if 0" prevents the "set a" from ever being executed. But at compile
time it has the effect of defining the variable attributes. I'v used this
technique where I create "shell" data sets that have the attributes I
want/need in applications and then use something like the above to make
sure my data sets are consistent.
-don
"Ya Huang" <huanga@WORLDNET.ATT.NET> wrote in message news:
<U2w_7.344387$W8.12857311@bgtnsc04-news.ops.worldnet.att.net>...
> data b;
> set a b (in=b);
> if b;
>
> where a and b has same variables, a has labels and b dose not have
> labels, after the 'set a b', new data will have a's all attributes, then
use
> 'if b' to subset it to b.
>
> HTH
>
> Ya Huang
>
> "Popovic, Jennifer" <popovic@RAND.ORG> wrote in message
> news:8B1F8133439DD3118134009027D60094044AE8AB@dcmail1.rand.org...
> > i have two datasets with nearly identical variables. one dataset has
> > variable labels; the other does not. is there any way i can easily
> transfer
> > the labels from one to the other. or is there a way to output the
labels
> > from one into code that could be run on the other?
> >
> > thanks,
> > jen
>
----------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.
|