Example 40.5 Retrieving All GVKEYs and Company Names
This example shows how to retrieve the GVKEY and name for every company in the CCM database.
title 'Retrieve All GVKEYs and Company Names';
libname _all_ clear;
libname crsp sasexccm "%sysget(CRSP_CCM)"
setid=250
itemlist="company";
proc contents data=crsp.company;
proc print data=crsp.company(keep=kygvkey conm obs=20);
run;
For brevity, only the first 20 observations are shown, and only KYGVKEY
and CONM
are kept in Output 40.5.1.
Output 40.5.1: First 20 GVKEYS and Company Names
The CONTENTS Procedure
CRSP.COMPANY |
. |
DATA |
38 |
CRSPCCM |
0 |
03/14/2014 15:08:13 |
3232 |
03/14/2014 15:08:13 |
0 |
|
NO |
|
NO |
|
|
Default |
|
Default |
|
ADD1 |
Char |
68 |
65. |
65. |
ADD1 |
ADD2 |
Char |
68 |
65. |
65. |
ADD2 |
ADD3 |
Char |
68 |
65. |
65. |
ADD3 |
ADD4 |
Char |
68 |
65. |
65. |
ADD4 |
ADDZIP |
Char |
24 |
24. |
24. |
ADDZIP |
BUSDESC |
Char |
2000 |
2000. |
2000. |
BUSDESC |
CIK |
Char |
12 |
10. |
10. |
CIK |
CITY |
Char |
104 |
104. |
104. |
CITY |
CONM |
Char |
256 |
255. |
255. |
CONM |
CONML |
Char |
104 |
100. |
100. |
CONML |
COSTAT |
Char |
4 |
1. |
1. |
COSTAT |
COUNTY |
Char |
104 |
100. |
100. |
COUNTY |
DLDTE |
Num |
8 |
8. |
8. |
DLDTE |
DLRSN |
Char |
12 |
8. |
8. |
DLRSN |
EIN |
Char |
12 |
10. |
10. |
EIN |
FAX |
Char |
24 |
18. |
18. |
FAX |
FIC |
Char |
16 |
3. |
3. |
FIC |
FYRC |
Num |
8 |
2. |
2. |
FYRC |
GGROUP |
Char |
12 |
4. |
4. |
GGROUP |
GIND |
Char |
12 |
6. |
6. |
GIND |
GSECTOR |
Char |
12 |
2. |
2. |
GSECTOR |
GSUBIND |
Char |
12 |
8. |
8. |
GSUBIND |
IDBFLAG |
Char |
12 |
1. |
1. |
IDBFLAG |
INCORP |
Char |
12 |
8. |
8. |
INCORP |
IPODATE |
Num |
8 |
8. |
8. |
IPODATE |
KYGVKEY |
Num |
8 |
6. |
6. |
GVKEY |
LOC |
Char |
4 |
3. |
3. |
LOC |
NAICS |
Char |
8 |
6. |
6. |
NAICS |
PHONE |
Char |
24 |
18. |
18. |
PHONE |
PRICAN |
Char |
12 |
8. |
8. |
PRICAN |
PRIROW |
Char |
12 |
8. |
8. |
PRIROW |
PRIUSA |
Char |
12 |
8. |
8. |
PRIUSA |
SIC |
Num |
8 |
4. |
4. |
SIC |
SPCINDCD |
Num |
8 |
4. |
4. |
SPCINDCD |
SPCSECCD |
Num |
8 |
4. |
4. |
SPCSECCD |
STATE |
Char |
12 |
8. |
8. |
STATE |
STKO |
Num |
8 |
1. |
1. |
STKO |
WEBURL |
Char |
68 |
60. |
60. |
WEBURL |
1000 |
A & E PLASTIK PAK INC |
1001 |
A & M FOOD SERVICES INC |
1002 |
AAI CORP |
1003 |
A.A. IMPORTING CO INC |
1004 |
AAR CORP |
1005 |
A.B.A. INDUSTRIES INC |
1006 |
ABC INDS INC |
1007 |
ABKCO INDUSTRIES INC |
1008 |
ABM COMPUTER SYSTEMS INC |
1009 |
ABS INDUSTRIES INC |
1010 |
ACF INDUSTRIES HOLDING CORP |
1011 |
ACS ENTERPRISES INC |
1012 |
ACS INDUSTRIES INC |
1013 |
ADC TELECOMMUNICATIONS INC |
1014 |
ADDSCO INDUSTRIES INC |
1015 |
ADI ELECTRONICS INC |
1016 |
AEC INC |
1017 |
AEL INDUSTRIES -CL A |
1018 |
AES TECHNOLOGY SYSTEMS INC |
1019 |
AFA PROTECTIVE SYSTEMS INC |