Example 38.7 Comparing Different Ways of Accessing CCM Data
You can use three different ways to select CCM data: by the primary key, GVKEY, or by either of the two secondary keys PERMNO and PERMCO. This section demonstrate the three different ways.
This example retrieves data on Cimflex Teknowledge Corporation which was previously known as Teknowledge Inc. This company is considered a single entity by the CRSP Stock database and is identified by PERMNO=10083 and PERMCO=8026. The Compustat database, however, considers Teknowledge Inc. and Cimflex Teknowledge Corporation as two separate entities, and each has its own GVKEY. Thus, PERMNO=10083 maps to GVKEYs 11947 and 15495, and PERMCO=8026 has the identical relationship. Access by PERMNO and PERMCO are equivalent in this case, but differ from access by GVKEY. PERMNO/PERMCO access retrieves data only within the active period of the links, and only the primary linked GVKEY is used for header access. In contrast, GVKEY access provides wide-open, full data for both GVKEYs. See PERMNO= option for more details.
title1 'Comparing various access methods for CCM data';
libname _all_ clear;
/* assign libnames for the three different access methods */
libname crsp1a sasecrsp "%sysget(CRSP_CST)"
setid=200
permno=10083
range='19870101-19900101';
libname crsp1b sasecrsp "%sysget(CRSP_CST)"
setid=200
permco=8026
range='19870101-19900101';
libname crsp2 sasecrsp "%sysget(CRSP_CST)"
setid=200
gvkey=11947 gvkey=15495
range='19870101-19900101';
title2 'PERMNO=10083 access of CCM data';
title3 'Sales (Net)';
data permnoaccess;
set crsp1a.iqitems(keep=gvkey rcaldt fiscaldt iq2);
run;
proc print data=permnoaccess;
run;
Output 38.7.1 shows PERMNO access of CCM quarterly 'Sales (Net)' data.
Output 38.7.1
PERMNO Access of CCM Data
11947 |
19870331 |
19870930 |
4.5680 |
11947 |
19870630 |
19871231 |
5.0240 |
11947 |
19870930 |
19880331 |
4.4380 |
11947 |
19871231 |
19880630 |
3.8090 |
11947 |
19880331 |
19880930 |
3.5420 |
11947 |
19880630 |
19881230 |
2.5940 |
15495 |
19890331 |
19890331 |
6.4660 |
15495 |
19890630 |
19890630 |
10.1020 |
15495 |
19890929 |
19890929 |
12.0650 |
15495 |
19891229 |
19891229 |
10.8780 |
title2 'GVKEY=11947 and GVKEY=15495 access of CCM data';
title3 'Sales (Net)';
data gvkeyaccess;
set crsp2.iqitems(keep=gvkey rcaldt fiscaldt iq2);
run;
proc print data=gvkeyaccess;
run;
Output 38.7.2 shows GVKEY access of CCM quarterly Sales data.
Output 38.7.2
GVKEY Access of CCM Data
11947 |
19870331 |
19870930 |
4.5680 |
11947 |
19870630 |
19871231 |
5.0240 |
11947 |
19870930 |
19880331 |
4.4380 |
11947 |
19871231 |
19880630 |
3.8090 |
11947 |
19880331 |
19880930 |
3.5420 |
11947 |
19880630 |
19881230 |
2.5940 |
11947 |
19880930 |
19890331 |
1.6850 |
11947 |
19881230 |
19890630 |
1.7080 |
15495 |
19880331 |
19880331 |
14.0660 |
15495 |
19880630 |
19880630 |
12.2770 |
15495 |
19880930 |
19880930 |
9.5960 |
15495 |
19881230 |
19881230 |
9.9800 |
15495 |
19890331 |
19890331 |
6.4660 |
15495 |
19890630 |
19890630 |
10.1020 |
15495 |
19890929 |
19890929 |
12.0650 |
15495 |
19891229 |
19891229 |
10.8780 |
title3 'LINK: Link information';
proc print data=crsp2.link;
run;
/* Show how PERMNO and PERMCO access are the same */
title4 'Proc compare of PERMNO vs. PERMCO access of CCM data';
proc compare base=crsp1a.iqitems compare=crsp1b.iqitems brief;
run;
Output 38.7.3 shows CRSP link information and comparison of GVKEY to PERMNO access.
Output 38.7.3
Link Information and Comparison
11947 |
19860305 |
19890226 |
10083 |
8026 |
LC |
BBB |
15495 |
19880101 |
19890226 |
0 |
0 |
NR |
XXX |
15495 |
19890227 |
19930909 |
10083 |
8026 |
LC |
BBB |
The COMPARE Procedure
Comparison of CRSP1A.IQITEMS with CRSP1B.IQITEMS
(Method=EXACT)
NOTE: No unequal values were found. All values compared are exactly equal.
|