After spending ten minutes,Finally understand somewhat you post.
1008/1/3 2008/1/16 C 1,99 2.0 756 25.0 23.42
Minimum ABS(strike price-settle price)= 22.5 13.42
You can use sql 's Cartestian Product to get it easily.
[pre]
Data data1;
input Date : yymmdd10. Exdate : yymmdd10. CP_FLAG $ Bid Ask Volum Strike_Price Settle_Price ;
format date yymmdd10. exdate :yymmdd10. ;
datalines;
2008/1/2 2008/1/16 C 2.3 2.6 2000 27.0 23.15
2008/1/2 2008/1/16 P 2.1 2.7 3000 27.0 23.15
2008/1/2 2008/1/16 C 2.4 2.5 5528 22.5 23.15
2008/1/2 2008/1/16 P 1.1 1.2 5617 22.5 23.15
2008/1/3 2008/1/16 C 1.99 2.0 756 25.0 23.42
2008/1/3 2008/1/16 P 2.99 3.0 654 25.0 23.42
2008/1/3 2008/1/16 C 2.05 2.2 783 22.5 23.42
2008/1/3 2008/1/16 P 1.20 1.2 150 22.5 23.42
;
run;
proc sql;
create table want as
select *
from data1
group by date
having abs(strike_price-settle_price)=min(abs(strike_price-settle_price))
;
run;
[/pre]
So weird , Why my post is always truncated.
Ksharp
Message was edited by: Ksharp
Message was edited by: Ksharp
... View more