- data old;
- input date yymmdd10. code $12. name $10. Price YTM volum duration tudu;
- format date yymmdd10.;
- cards;
- 2016-3-31 150218.IB 15国开18 103.7198 3.2738 1680000 8.0082 74.4721
- 2016-3-31 160401.IB 16农发01 100.0196 2.4301 634000 0.7699 1.2987
- 2016-3-31 150210.IB 15国开10 106.5665 3.355 625000 7.4693 66.4642
- 2016-3-31 160408.IB 16农发08 100.0991 3.3575 473000 8.5682 83.2349
- 2016-3-31 150207.IB 15国开07 102.8417 2.705 441000 1.8921 5.3589
- 2016-3-30 150405.IB 15农发05 104.3136 3.4 332000 7.6888 67.7383
- 2016-3-30 150220.IB 15国开20 101.7638 3.03 322000 4.1675 21.1054
- 2016-3-30 150208.IB 15国开08 104.1179 3.03 319000 3.6673 17.0548
- 2016-3-30 150413.IB 15农发13 100.026 2.4498 309000 0.1425 0.1551
- 2016-3-30 150211.IB 15国开11 100.0795 2.4101 298000 0.1151 0.1223
- 2016-3-30 150414.IB 15农发14 101.4893 2.7114 262000 2.0449 6.0478
- ;
- run;
- proc sql noprint;
- create table date_list as
- select distinct date from old;
- create table code_list as
- select distinct code, name from old;
- create table data_code_list as
- select * from date_list, code_list;
- create table new as
- select * from data_code_list as a left join old as b
- on a.date=b.date and a.code=b.code;
- quit;
- proc sort data=new;
- by code date;
- run;
- data new;
- set new;
- by code date;
- retain price_temp YTM_temp volum_temp duration_temp tudu_temp;
- if not missing(price) or first.code then do;
- price_temp=price;
- YTM_temp=YTM;
- volum_temp=volum;
- duration_temp=duration;
- tudu_temp=tudu;
- end;
- else do;
- price=price_temp;
- YTM=YTM_temp;
- volum=volum_temp;
- duration=duration_temp;
- tudu=tudu_temp;
- end;
- run;


雷达卡





京公网安备 11010802022788号







