- data a;
- input c $ date yymmdd10. type $;
- datalines;
- 1 2017-10-5 a
- 2 2014-10-5 b
- 1 2017-10-6 v
- 1 2017-10-4 d
- run;
- data b;
- input c $ date yymmdd10. price;
- datalines;
- 1 2017-10-5 25
- 2 2014-10-6 36
- 1 2017-10-6 20
- run;
- proc sort data=a;
- by c date;
- run;
- proc sort data=b;
- by c date;
- run;
- data c;
- merge a b;
- by c date;
- If type="" then type=".";
- run;
如果要將空格(字串的缺失值)變成數(shù)值的缺失值,用IF Function就可以了