Qbik
Qbik

Reputation: 6147

Simple copying part of one set to another in SAS

I'm trying to copy one part of dataset to another in SAS, example :

dataset X
X Y
1 12
31 4
5 3

dataset Y
X Y
12 7
9 3

I would like to copy cells which in this case contain 31 and 12 from dataset X to Y and obtain :

dataset Y
X Y
12 7
9 3
31 12

I was to mix 'obs=' 'where' 'if' and variable names in one proc none of the combinations worked.

Upvotes: 0

Views: 99

Answers (1)

Joe
Joe

Reputation: 63424

Examples of the various things you talked about:

data want;
set have1(where=(var1=value1)) have2;
run;



data want;
set have1(in=a) have2(in=b);
if (a or (b and var1=value1));
run;


data want;
set have1(obs=2) have2;
run;

I don't imagine you'd want to mix them, any one should be sufficient for what you're talking about.

Upvotes: 2

Related Questions