For my research i need to get the yearly median of the bid- ask spread. I wrote a syntax but on some point of the syntax I keep getting an error. Can somebody help me with this by telling what is wrong and how to correct it. The error happens with the last line of the syntax shown below.
The errors that are shown are:
ERROR: File WORK.TEMP.DATA does not exist.
ERROR 180-322: Statement is not valid or it is used out of proper order.
The syntax is:
/*sort data ask*/
PROC IMPORT OUT= WORK.Temp1 DATAFILE= "C:\Users\Marcel\Documents\school\Master\thesis\Data\modified\bid ask spread\roos1.xls"
DBMS=EXCEL REPLACE; SHEET="'S1X(PA)$'"; GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; run;
proc transpose data=temp1 out=Temp2 (rename=(col1=Ask) drop= _LABEL_) name=ISIN;
var UKB16TW23_PA__E UK5884823_PA__E UK4264512_PA__E UKB23PWM1_PA__E UK5824391_PA__E
; by Date notsorted; run;
data ask (rename=(ask_n=ask)); set temp2;
ask_n=ask;
sedol=substr(isin,3,7); drop isin ask;
run;
/*sort data bid*/
PROC IMPORT OUT= WORK.Temp1 DATAFILE= "C:\Users\Marcel\Documents\school\Master\thesis\Data\modified\bid ask spread\roos1.xls"
DBMS=EXCEL REPLACE; SHEET="'S1X(PB)$'"; GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; run;
proc transpose data=temp1 out=Temp2 (rename=(col1=Bid) drop= _LABEL_) name=ISIN;
var UKB16TW23_PB__E UK5884823_PB__E UK4264512_PB__E UKB23PWM1_PB__E UK5824391_PB__E
; by Date notsorted; run;
data bid (rename=(bid_n=bid)); set temp2;
bid_n=bid;
sedol=substr(isin,3,7); drop isin bid;
run;
proc sql; create table BAS as select
a.*, b.bid, (a.ask-b.bid)*2/(a.ask+b.bid) as BAS
from ask as a inner join bid as b
on a.sedol=b.sedol and a.date=b.date
order by a.sedol, a.date;quit;
data temp1; set temp; year=year(date);
With this line I keep getting the error.