Example 39.1 Retrieving SALE Data for One GVKEY

This simple example shows how to retrieve SALE data for one particular GVKEY=6066 (IBM). Since the ITEMLIST= option does not specify a keyset, the default (standard) keyset, KEYSET_TAG=STD, is selected. For brevity, a subset of the data with the most recent figures is specified by the WHERE statement.

title 'Retrieve SALE data for IBM';
libname _all_ clear;

libname crsp sasexccm "%sysget(CRSP_CCM)"
   setid=250
   gvkey=6066
   itemlist="sale";

data recentsales;
    set crsp.annitem;
    where datadate >= '1jan2000'd;

proc print data=recentsales;
run;

Output 39.1.1 SALE Data for GVKEY=6066
Retrieve SALE data for IBM

Obs KYGVKEY KEYSET_TAG DATADATE SALE
1 6066 STD 20001229 88396.0000
2 6066 STD 20011231 85866.0000
3 6066 STD 20021231 81186.0000
4 6066 STD 20031231 89131.0000
5 6066 STD 20041231 96293.0000
6 6066 STD 20051230 91134.0000
7 6066 STD 20061229 91424.0000
8 6066 STD 20071231 98786.0000


Note: This procedure is experimental.