This example shows how to retrieve several data items in different keysets. The ITEMLIST= option asks for data on research and development (R&D) expenses, XRD, and net income, NI, over all available keysets by using the itm_name.* syntax in the ITEMLIST= option. Note that data is not available for all items in all keysets. For brevity, a subset of the data with the most recent figures is specified by the WHERE statement.
title 'Retrieve R&D Expenses and Net Income for IBM'; libname _all_ clear; libname crsp sasexccm "%sysget(CRSP_CCM)" setid=250 gvkey=6066 itemlist="xrd.*;ni.*"; data recent; set crsp.annitem; where datadate >= '1jan2001'd; proc print data=recent; run;
Retrieve R&D Expenses and Net Income for IBM |
Obs | KYGVKEY | KEYSET_TAG | DATADATE | XRD | NI |
---|---|---|---|---|---|
1 | 6066 | STD | 20011231 | 4620.0000 | 7723.0000 |
2 | 6066 | STD | 20021231 | 4754.0000 | 3579.0000 |
3 | 6066 | STD | 20031231 | 5077.0000 | 7583.0000 |
4 | 6066 | STD | 20041231 | 5167.0000 | 8430.0000 |
5 | 6066 | STD | 20051230 | 5379.0000 | 7934.0000 |
6 | 6066 | STD | 20061229 | 5682.0000 | 9492.0000 |
7 | 6066 | STD | 20071231 | 5754.0000 | 10418.0000 |
8 | 6066 | SUMM | 20011231 | . | 6484.0000 |
9 | 6066 | SUMM | 20021231 | . | 2376.0000 |
10 | 6066 | SUMM | 20031231 | . | 6558.0000 |
11 | 6066 | SUMM | 20041231 | . | 7479.0000 |
12 | 6066 | SUMM | 20051230 | . | 7934.0000 |
13 | 6066 | SUMM | 20061229 | . | 9492.0000 |
14 | 6066 | SUMM | 20071231 | . | 10418.0000 |
Note: This procedure is experimental.