Previous Page | Next Page

The SASECRSP Interface Engine

Example 33.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 33.7.1 shows PERMNO access of CCM quarterly 'Sales (Net)' data.

Output 33.7.1 PERMNO Access of CCM Data
Comparing various access methods for CCM data
PERMNO=10083 access of CCM data
Sales (Net)

Obs GVKEY RCALDT FISCALDT IQ2
1 15495 19870331 19870930 4.5680
2 15495 19870630 19871231 5.0240
3 15495 19870930 19880331 4.4380
4 15495 19871231 19880630 3.8090
5 15495 19880331 19880930 3.5420
6 15495 19880630 19881230 2.5940
7 15495 19890331 19890331 6.4660
8 15495 19890630 19890630 10.1020
9 15495 19890929 19890929 12.0650
10 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 33.7.2 shows GVKEY access of CCM quarterly Sales data.

Output 33.7.2 GVKEY Access of CCM Data
Comparing various access methods for CCM data
GVKEY=11947 and GVKEY=15495 access of CCM data
Sales (Net)

Obs GVKEY RCALDT FISCALDT IQ2
1 11947 19870331 19870930 4.5680
2 11947 19870630 19871231 5.0240
3 11947 19870930 19880331 4.4380
4 11947 19871231 19880630 3.8090
5 11947 19880331 19880930 3.5420
6 11947 19880630 19881230 2.5940
7 11947 19880930 19890331 1.6850
8 11947 19881230 19890630 1.7080
9 15495 19880331 19880331 14.0660
10 15495 19880630 19880630 12.2770
11 15495 19880930 19880930 9.5960
12 15495 19881230 19881230 9.9800
13 15495 19890331 19890331 6.4660
14 15495 19890630 19890630 10.1020
15 15495 19890929 19890929 12.0650
16 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 33.7.3 shows CRSP link information and comparison of GVKEY to PERMNO access.

Output 33.7.3 Link Information and Comparison
Comparing various access methods for CCM data
GVKEY=11947 and GVKEY=15495 access of CCM data
LINK: Link information
Proc compare of PERMNO vs. PERMCO access of CCM data

Obs GVKEY LINKDT LINKENDT NPERMNO NPERMCO LINKTYPE LINKFLAG
1 11947 19860305 19890226 10083 8026 LC BBB
2 15495 19880101 19890226 0 0 NR XXX
3 15495 19890227 19930909 10083 8026 LC BBB

Comparing various access methods for CCM data
GVKEY=11947 and GVKEY=15495 access of CCM data
LINK: Link information
Proc compare of PERMNO vs. PERMCO access of CCM data

                             The COMPARE Procedure                              
                Comparison of CRSP1A.IQITEMS with CRSP1B.IQITEMS                
                                 (Method=EXACT)                                 
                                                                                
NOTE: No unequal values were found. All values compared are exactly equal.      

Previous Page | Next Page | Top of Page