The SASECRSP Interface Engine |
Example 33.5 Specifying Ranges for Individual Keys with the INSET= Option
Insets enable you to define options specific to each individual key. This example uses an inset to select four PERMNOs and specifies a different date restriction for each PERMNO.
title2 'INSET=testin2 uses date ranges along with PERMNOs:';
title3 '10107, 12490, 14322, 25788';
title4 'Begin dates and end dates for each permno are used in the INSET';
data testin2;
permno = 10107; date1 = 19980731; date2 = 19981231; output;
permno = 12490; date1 = 19970101; date2 = 19971231; output;
permno = 14322; date1 = 19950731; date2 = 19960131; output;
permno = 25778; date1 = 19950101; date2 = 19950331; output;
run;
libname _all_ clear;
libname mstk2 sasecrsp "%sysget(CRSP_MSTK)"
setid=20
inset='testin2,PERMNO,PERMNO,DATE1,DATE2';
data b;
set mstk2.prc;
run;
proc print data=b;
run;
Output 33.5.1 shows CRSP Stock price time series data selected by PERMNO in the INSET= option, where each PERMNO has its own time span specified in the INSET= option.
Output 33.5.1
PRC Monthly Time Series Using INSET= Option
|
10107 |
19980731 |
109.93750 |
10107 |
19980831 |
95.93750 |
10107 |
19980930 |
110.06250 |
10107 |
19981030 |
105.87500 |
10107 |
19981130 |
122.00000 |
10107 |
19981231 |
138.68750 |
12490 |
19970131 |
156.87500 |
12490 |
19970228 |
143.75000 |
12490 |
19970331 |
137.25000 |
12490 |
19970430 |
160.50000 |
12490 |
19970530 |
86.50000 |
12490 |
19970630 |
90.25000 |
12490 |
19970731 |
105.75000 |
12490 |
19970829 |
101.37500 |
12490 |
19970930 |
106.00000 |
12490 |
19971031 |
98.50000 |
12490 |
19971128 |
109.50000 |
12490 |
19971231 |
104.62500 |
14322 |
19950731 |
32.62500 |
14322 |
19950831 |
32.37500 |
14322 |
19950929 |
36.87500 |
14322 |
19951031 |
34.00000 |
14322 |
19951130 |
39.37500 |
14322 |
19951229 |
39.00000 |
14322 |
19960131 |
41.50000 |
25778 |
19950131 |
49.87500 |
25778 |
19950228 |
57.25000 |
25778 |
19950331 |
59.37500 |
Copyright
© 2008 by SAS Institute Inc., Cary, NC, USA. All
rights reserved.