Using Different Types of Range Restriction in the INSET
/*----------------------------------------------------------------
SAS Sample Library
Name: crpex10.sas
Description: Example program from SAS/ETS User's Guide,
The SASECRSP Interface Engine
Title: Using Different Types of Range Restriction in the INSET
Product: SAS/ETS Software
Keys: CCM data access, CRSPAccess, Fiscal date range, INSET= option
Procs: SASECRSP
Notes: Read this before you run this sample.
The CRSP CCM database resides in the CRSP_CST folder. You
must install your CRSP COMPUSTAT Merged data
and define your Windows system environment
variable, CRSP_CST, to point to the physical path
of your installed CRSP CCM database. Use the following
form of the libname statement:
libname fisclib sasecrsp "%sysget(CRSP_CST)"
SETID=200
INSET='comp_fiscal,compkey,gvkey,begdate,enddate,datetype';
----------------------------------------------------------------*/
data comp_fiscal;
/* Crude Petroleum & Natural Gas */
compkey=2416;
begdate=19860101; enddate=19861231;
datetype='fiscal';
output;
/* Commercial Intertech */
compkey=3248;
begdate=19940101; enddate=19941231;
datetype='fiscal';
output;
run;
data comp_calendar;
/* Crude Petroleum & Natural Gas */
compkey=2416;
begdate=19860101; enddate=19861231;
datetype='calendar'; output;
/* Commercial Intertech */
compkey=3248;
begdate=19940101; enddate=19941231;
datetype='calendar';
output;
run;
libname _all_ clear;
libname fisclib sasecrsp "%sysget(CRSP_CST)"
SETID=200
INSET='comp_fiscal,compkey,gvkey,begdate,enddate,datetype';
libname callib sasecrsp "%sysget(CRSP_CST)"
SETID=200
INSET='comp_calendar,compkey,gvkey,begdate,enddate,datetype';
title1 'Quarterly Period Descriptors';
title2 'Using the Fiscal Date Range';
proc print data=fisclib.qperdes(drop = peftnt1 peftnt2 peftnt3 peftnt4
peftnt5 peftnt6 peftnt7 peftnt8
candxc flowcd spbond spdebt sppaper);
run;
title1 'Quarterly Period Descriptors';
title2 'Using the Calendar Date Range';
proc print data=callib.qperdes(drop = peftnt1 peftnt2 peftnt3 peftnt4
peftnt5 peftnt6 peftnt7 peftnt8
candxc flowcd spbond spdebt sppaper);
run;