Date: Tue, 8 Jan 2002 06:44:22 GMT
Reply-To: Huck <huck@SKIPTHISFINN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Huck <huck@SKIPTHISFINN.COM>
Organization: AT&T Worldnet
Subject: Re: transfer/copy variable labels from one dataset to another?
based on this direction instead of creating the labels from the dictionary tables.
the following method here may be "better", less i/o, a is opend but little i/o is done to it.
_n_ is never 0, but the attributes of the dataset are assumed just by the use of the set statment.
but i forget which "sticks" the first or the last dataset opened, im betting on the first one.
(but this is contrary to the "rightmost dataset" rule the previous poster used ... rightmost is
last, and i dont want to login to test. one of these will work)
data c; if _n_=0 then set a; set b;
or
data c; set b; if _n_=0 then set a;
there is a guy who can do this with a one statment sql into a macro var,
and a proc datasets; modify ... kinda statment i think it was ...
its cute as the dickens, he should take the credit tho...
ill give you a hint :
the dictionary tables, concatination, functions, text strings and seperated-by are all involved.
ill post it if he doesnt again, its gotta be indexed in something ....
On Tue, 08 Jan 2002 06:09:56 GMT, "Ya Huang" <huanga@worldnet.att.net> wrote:
>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
>
>
|