Dear All, as a complete SAS newbie, I need to download & clean TRACE data from WRDS. Unfortunately I do not have access to SAS directly (as in having the software on my computer), but I can use SAS Studio in my webbrower thanks to WRDS. The cleaning procedure is already implemented in SAS, see the appended PDF. I only need to figure out how to access the TRACE data and put in memory such that the cleaning procedure works and then how to save the data. Using the web interface (I think) I have been able to access the dataset, using the following lines of code: PROC SQL;
CREATE TABLE WORK.query AS
SELECT cusip_id , bond_sym_id , company_symbol , trd_exctn_dt , trd_exctn_tm , trd_rpt_dt , trd_rpt_tm , msg_seq_nb , trc_st , scrty_type_cd , wis_fl , cmsn_trd , entrd_vol_qt , rptd_pr , yld_sign_cd , yld_pt , asof_cd , days_to_sttl_ct , sale_cndtn_cd , sale_cndtn2_cd , rpt_side_cd , buy_cmsn_rt , buy_cpcty_cd , sell_cmsn_rt , sell_cpcty_cd , cntra_mp_id , agu_qsr_id , spcl_trd_fl , trdg_mkt_cd , dissem_fl , orig_msg_seq_nb , SUB_PRDCT , STLMNT_DT , TRD_MOD_3 , TRD_MOD_4 , LCKD_IN_IND , PR_TRD_DT FROM TRACE.TRACE_ENHANCED;
RUN;
QUIT;
PROC DATASETS NOLIST NODETAILS;
CONTENTS DATA=WORK.query OUT=WORK.details;
RUN;
PROC PRINT DATA=WORK.details;
RUN; if I click "OUTPUT DATA" ribbon, it looks quite what I was looking for. The begining of the code of the cleaning procedure (the whole code is in the pdf) is the following: * The name of the original Enhanced TRACE dataset
* supplied to the program;
%LET IN = traceIN;
* The name given to the cleaned Enhanced TRACE dataset;
%Let OUT = traceCLEAN;
* Path to your library containing the dataset;
* The cleaned dataset will be stored in this location;
Libname TRACE 'C:\Enhanced TRACE';
dm 'clear log';
dm 'clear output';
data temp_raw
temp_deleteI_NEW (keep = cusip_id entrd_vol_qt rptd_pr
trd_exctn_dt trd_exctn_tm rpt_side_cd cntra_mp_id
msg_seq_nb)
temp_deleteII_NEW (keep = cusip_id entrd_vol_qt rptd_pr
trd_exctn_dt trd_exctn_tm rpt_side_cd cntra_mp_id
orig_msg_seq_nb);
set trace.∈
where trd_rpt_dt ge '06Feb2012'd;
* Deletes observations without a cusip_id;
if cusip_id = '' then delete;
... I am basically missing some lines in between. How to link "CONTENTS DATA" to "%LET IN =" Unfortunately I completely lack SAS knowledge. Can someone point me to the right syntax here? Thanks in advance, Best! ---------------- EDIT: Thanks LinusH for pointing out that the PDF was missing in my original post.
... View more