Date: Tue, 13 Jul 2004 08:25:10 -0700
Reply-To: Wini <wottoy@ADVALVAS.BE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Wini <wottoy@ADVALVAS.BE>
Subject: SAS Macro - merge
Content-Type: text/plain; charset=ISO-8859-1
I have a problem with merging datasets within a macro. I would like to
retain for each survey (in fact it are waves) the indid. Therefore I
create indidX = indid. For a wave were the indid is present I would
like to have that indid else a missing, but the only thing I get is a
matrix with all indids. (it seemst that the value from the first
datset, a list of all possible indids) is retained.
The indid is called indid in all files, but I like to have a file with
indid1 indid2 indi3
suppose contac contains
wave1 contains a datset with
wave2 contains a datset with
then I would like to have a dataset with
indid indid1 indid2
1111 . .
1245 1245 1245
2548 . 2548
3655 3655 .
What is wrong with this code?
%do i=&iniw %to &endw;
data &target(keep= indid &vars&iniw-&vars&i );
merge &bib&i..w&i.&dsn &target ;
Thanks in advance!