Lynn
Lynn

Reputation: 19

sas--deal with missing values?

Here is the original data:

data new;
input id a b c;
cards;
1 41 . .
1 . 42 .
1 . . 43
;
run;

How can I get the output like this?

id a b c
1 41 42 43

Upvotes: 0

Views: 45

Answers (1)

Reeza
Reeza

Reputation: 21294

Do it in two steps. First read as is and then use the UPDATE trick below.

Data want;
update new(obs=0) new;
by ID;
run;

Another option is to summarize the data, if you take a statistic on each column it will be the unique value but the update is the quickest.

Upvotes: 1

Related Questions