forked from crux26/CRSP_local
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPracticeHere.sas
65 lines (42 loc) · 2.03 KB
/
PracticeHere.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*START AGAIN FROM /AMBIGUITY_CODES/SPXDATA_TRIM_2ND (2017.10.26)*/
/* Currently working on <indadjbm to portfolios>. */
/* # of result firms from <B2M ratio - DT> are too small compared to <B2M ratio - FF>. */
/* WARNING: in PROC SORT, NODUPKEY and NODUPLICATES are DIFFERENT. */
/* NODUPLICATES (=NODUP): delete duplicated observations (records identical to each other). */
/* NODUPKEY: delete observations with duplicate BY values (the sort BY variables). */
/* After that, re-check FF factors replication.sas, and find a way to form portfolio returns */
/* using indadjbm (industry-adjusted B2M). (2017.08.28) */
/*COMPUSTAT: NO MORE /d_na, but /naa (use /nam instead)*/
/*a_ccm.ccmxpf_linktable: almost equivalent to a_ccm.ccmxpf_lnkhist */
/* The identification of a fiscal year is the calendar year in which it ends.*/
/* FY: from t-1, July to t, June prior to 1976.*/
/*ex) FY17: Oct, 2016 ~ Sep, 2017. */
/*ex) datadate=20080531, fyear=2007, fyr=5 --> Jun, 2006 ~ May, 2007 written at 20080531. */
/*ex) datadate=20090930, fyear=2009, fyr=9 --> Aug, 2008 ~ Sep, 2009 written at 20090930. */
/*%include myMacro('SetDate.sas'); WILL NOT work unless */
/*-SASINITIALFOLDER "D:\Dropbox\GitHub\CRSP_local" added to sasv9.cfg in ...\nls\en and \ko*/
/* To automatically point to the macros in this library within your SAS program */
options sasautos=('E:\Dropbox\GitHub\CRSP_local\myMacro\', SASAUTOS) MAUTOSOURCE;
%liblist_lab;
options mstored sasmstore=myMacro;
options sasautos=('E:\Dropbox\GitHub\CRSP_local\myMacro\', SASAUTOS) MAUTOSOURCE;
%liblist_dorm;
options mstored sasmstore=myMacro;
%let begdate = '01MAY1961'd;
%let enddate = '31DEC1965'd;
data dsf_subset;
set bem.dsf_dlret_ff3f;
where date between '01JUL1961'd and '31DEC1966'd;
run;
proc sort data=dsf_subset;
by permno date;
run;
/**/
%let wrds=wrds.wharton.upenn.edu 4016;
options comamid=TCP remote=WRDS;
signon username=ex1k password='Dhssnfl2@';
rsubmit;
data mytaq;
set taq.ct_201301:(where=(SYMBOL='MSFT' and time between '09:30:00't and '16:00:00't)) open=defer;
run;
endrsubmit;