/* The first step is SAS code to build the request file for the demo. */ /* Your request file could be built this way, or imported from Excel */ /* or from another format, or could be a plain text file. */ /* */ /* The second date is read in as EventDa2 for conversion purposes. */ /* */ /* The fourth column is an optional supplemental identifying vari- */ /* able. If one is not used, omit the ID= options in all Eventus code.*/ data request0; input CUSIP:$8. EventDate:yymmdd8. EventDa2:yymmdd8. Deal:3.0; datalines; 38141G10 20011127 20020107 2 70756910 20010625 20020213 30 17247410 20011128 20020219 34 57791410 20010518 20020312 63 91087320 20020125 20020314 69 88077910 20011210 20020418 103 32051K10 20020305 20020419 104 46072H10 20020418 20020508 119 73157210 20020227 20020508 122 12791410 20020506 20020521 134 03748R10 20011012 20020530 144 69351T10 20020906 20020912 201 03738910 20011203 20021104 221 39116410 20020429 20021121 237 run; /* Start WRDS PC SAS Connect Remote Submit Session */ options nomautosource noimplmac; run; %let wrds = wrds.wharton.upenn.edu 4016; options comamid=TCP remote=WRDS; signon username=_prompt_; /* (user responds to the user name/password popup) */ rsubmit; options ps=50; /* Upload the request file. */ proc upload data=request0 out=request0; run; /* Convert the event and reference dates to CRSP trading day numbers. */ Eventus twin; DateConv insas=request0 cusiperm outsas=temp1 id=Deal; /* Shift the reference date 150 trading days later for post-event estimation. */ /* If pre-event estimation is preferred, use a negative shift. We are creating */ /* the estimation period ending date, so whether positive or negative shift is */ /* used, make sure the result is the date on which we want the estimation */ /* period to end, not begin. */ Eventus twin; DateConv insas=temp1 datefmt=crsp shift2=+150 outsas=request id=Deal; /* Rename the CRSP-date variables to the required column names for event date and estimation period ending date. */ proc datasets library=work nolist; modify request; rename crspday1=crspday crspday2=crspest; quit; /* Run the event study, using datefmt=crsp to use crspday as the event date, */ /* est=specific to use crspest as the last trading day of the estimation period */ /* (both specified as CRSP dates) and estlen=120 to specify a 120 trading day */ /* long estimation period. */ Eventus; title 'Registration Date -- Estimation Period is Offering Date (+31,+150)'; Request inSAS=request datefmt=crsp est=specific estlen=120 id=Deal; Windows (-1,+1) (-2,+2) (-30,-3); EvtStudy StdCSect; /* Conclude WRDS remote submission. */ endrsubmit; signoff;