<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic help, keep getting an error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65128#M18562</link>
    <description>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.&lt;BR /&gt;
&lt;BR /&gt;
The errors that are shown are:&lt;BR /&gt;
ERROR: File WORK.TEMP.DATA does not exist.&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
The syntax is:&lt;BR /&gt;
/*sort data ask*/&lt;BR /&gt;
PROC IMPORT OUT= WORK.Temp1 DATAFILE=  "C:\Users\Marcel\Documents\school\Master\thesis\Data\modified\bid ask spread\roos1.xls" &lt;BR /&gt;
 DBMS=EXCEL REPLACE;   SHEET="'S1X(PA)$'";    GETNAMES=YES;     MIXED=NO;     SCANTEXT=YES;     USEDATE=YES;     SCANTIME=YES; run;&lt;BR /&gt;
&lt;BR /&gt;
 proc transpose data=temp1 out=Temp2 (rename=(col1=Ask) drop= _LABEL_)  name=ISIN;&lt;BR /&gt;
  var UKB16TW23_PA__E	UK5884823_PA__E	UK4264512_PA__E	UKB23PWM1_PA__E	UK5824391_PA__E	&lt;BR /&gt;
;  by Date notsorted;  run; &lt;BR /&gt;
data ask (rename=(ask_n=ask)); set temp2;&lt;BR /&gt;
ask_n=ask; &lt;BR /&gt;
sedol=substr(isin,3,7); drop isin ask; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/*sort data bid*/&lt;BR /&gt;
PROC IMPORT OUT= WORK.Temp1 DATAFILE=  "C:\Users\Marcel\Documents\school\Master\thesis\Data\modified\bid ask spread\roos1.xls" &lt;BR /&gt;
 DBMS=EXCEL REPLACE;   SHEET="'S1X(PB)$'";    GETNAMES=YES;     MIXED=NO;     SCANTEXT=YES;     USEDATE=YES;     SCANTIME=YES; run;&lt;BR /&gt;
 proc transpose data=temp1 out=Temp2 (rename=(col1=Bid) drop= _LABEL_)  name=ISIN;&lt;BR /&gt;
  var UKB16TW23_PB__E	UK5884823_PB__E	UK4264512_PB__E	UKB23PWM1_PB__E	UK5824391_PB__E		&lt;BR /&gt;
;  by Date notsorted;  run; &lt;BR /&gt;
data bid (rename=(bid_n=bid)); set temp2;&lt;BR /&gt;
bid_n=bid; &lt;BR /&gt;
sedol=substr(isin,3,7); drop isin bid; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql; create table BAS as select &lt;BR /&gt;
a.*, b.bid, (a.ask-b.bid)*2/(a.ask+b.bid) as BAS&lt;BR /&gt;
from ask as a inner join bid as b &lt;BR /&gt;
on  a.sedol=b.sedol and a.date=b.date&lt;BR /&gt;
order by a.sedol, a.date;quit; &lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;data temp1; set temp; year=year(date);&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
With this line I keep getting the error.</description>
    <pubDate>Thu, 12 May 2011 09:39:20 GMT</pubDate>
    <dc:creator>mroos</dc:creator>
    <dc:date>2011-05-12T09:39:20Z</dc:date>
    <item>
      <title>help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65128#M18562</link>
      <description>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.&lt;BR /&gt;
&lt;BR /&gt;
The errors that are shown are:&lt;BR /&gt;
ERROR: File WORK.TEMP.DATA does not exist.&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
The syntax is:&lt;BR /&gt;
/*sort data ask*/&lt;BR /&gt;
PROC IMPORT OUT= WORK.Temp1 DATAFILE=  "C:\Users\Marcel\Documents\school\Master\thesis\Data\modified\bid ask spread\roos1.xls" &lt;BR /&gt;
 DBMS=EXCEL REPLACE;   SHEET="'S1X(PA)$'";    GETNAMES=YES;     MIXED=NO;     SCANTEXT=YES;     USEDATE=YES;     SCANTIME=YES; run;&lt;BR /&gt;
&lt;BR /&gt;
 proc transpose data=temp1 out=Temp2 (rename=(col1=Ask) drop= _LABEL_)  name=ISIN;&lt;BR /&gt;
  var UKB16TW23_PA__E	UK5884823_PA__E	UK4264512_PA__E	UKB23PWM1_PA__E	UK5824391_PA__E	&lt;BR /&gt;
;  by Date notsorted;  run; &lt;BR /&gt;
data ask (rename=(ask_n=ask)); set temp2;&lt;BR /&gt;
ask_n=ask; &lt;BR /&gt;
sedol=substr(isin,3,7); drop isin ask; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/*sort data bid*/&lt;BR /&gt;
PROC IMPORT OUT= WORK.Temp1 DATAFILE=  "C:\Users\Marcel\Documents\school\Master\thesis\Data\modified\bid ask spread\roos1.xls" &lt;BR /&gt;
 DBMS=EXCEL REPLACE;   SHEET="'S1X(PB)$'";    GETNAMES=YES;     MIXED=NO;     SCANTEXT=YES;     USEDATE=YES;     SCANTIME=YES; run;&lt;BR /&gt;
 proc transpose data=temp1 out=Temp2 (rename=(col1=Bid) drop= _LABEL_)  name=ISIN;&lt;BR /&gt;
  var UKB16TW23_PB__E	UK5884823_PB__E	UK4264512_PB__E	UKB23PWM1_PB__E	UK5824391_PB__E		&lt;BR /&gt;
;  by Date notsorted;  run; &lt;BR /&gt;
data bid (rename=(bid_n=bid)); set temp2;&lt;BR /&gt;
bid_n=bid; &lt;BR /&gt;
sedol=substr(isin,3,7); drop isin bid; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql; create table BAS as select &lt;BR /&gt;
a.*, b.bid, (a.ask-b.bid)*2/(a.ask+b.bid) as BAS&lt;BR /&gt;
from ask as a inner join bid as b &lt;BR /&gt;
on  a.sedol=b.sedol and a.date=b.date&lt;BR /&gt;
order by a.sedol, a.date;quit; &lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;data temp1; set temp; year=year(date);&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
With this line I keep getting the error.</description>
      <pubDate>Thu, 12 May 2011 09:39:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65128#M18562</guid>
      <dc:creator>mroos</dc:creator>
      <dc:date>2011-05-12T09:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65129#M18563</link>
      <description>This data set temp isn't mentioned anywhere before in your code, it is not created. Maybe it is just misspelling and you wanted to reference some other data set in this step:&lt;BR /&gt;
data temp1; set &lt;B&gt;temp&lt;/B&gt;; year=year(date);&lt;BR /&gt;
(from which data set you want to create that new one? )</description>
      <pubDate>Thu, 12 May 2011 10:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65129#M18563</guid>
      <dc:creator>ieva</dc:creator>
      <dc:date>2011-05-12T10:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65130#M18564</link>
      <description>I indeed refered to the wrong data set. I corrected for this and now the first error is solved. But I still get the second error:&lt;BR /&gt;
&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
Does anybody what this error exactly means and how to solve this?</description>
      <pubDate>Thu, 12 May 2011 12:36:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65130#M18564</guid>
      <dc:creator>mroos</dc:creator>
      <dc:date>2011-05-12T12:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65131#M18565</link>
      <description>Hello Mroos,&lt;BR /&gt;
&lt;BR /&gt;
Please provide us with a small example of temp.&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Thu, 12 May 2011 13:18:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65131#M18565</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-05-12T13:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65132#M18566</link>
      <description>Dear Mroos,&lt;BR /&gt;
&lt;BR /&gt;
Run each dataset or procedure one by one.  When you do this, you exactly know which module is failing.  Narrowing down process simplifies error detection.&lt;BR /&gt;
&lt;BR /&gt;
Post the module which has issues.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Sandhya.</description>
      <pubDate>Thu, 12 May 2011 15:00:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65132#M18566</guid>
      <dc:creator>Sandhya</dc:creator>
      <dc:date>2011-05-12T15:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65133#M18567</link>
      <description>You need to show the log, so we can see which statement it is complaining about.  Most of the time, that means there is a typo somewhere.</description>
      <pubDate>Thu, 12 May 2011 15:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65133#M18567</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-05-12T15:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65134#M18568</link>
      <description>It was indeed a type error or that te order was wrong. It works now.&lt;BR /&gt;
All thanks for the help.</description>
      <pubDate>Thu, 12 May 2011 15:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/65134#M18568</guid>
      <dc:creator>mroos</dc:creator>
      <dc:date>2011-05-12T15:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/255366#M57056</link>
      <description>&lt;P&gt;Hi Mroos,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How did you solve the error "STATEMENT IS NOT VALID OR IT IS USED OUT OF PROPER ORDER "?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am stuck in this error, and have no idea how to solve this error. The error points to some of my options like MIXED=, GUESSINGROWS= ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2016 21:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/255366#M57056</guid>
      <dc:creator>Meng_Xu</dc:creator>
      <dc:date>2016-03-08T21:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: help, keep getting an error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/255432#M57064</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76695"&gt;@Meng_Xu&lt;/a&gt; Please post your question as a new thread. This one is more than 5 years old. Please include your code and log.</description>
      <pubDate>Wed, 09 Mar 2016 03:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-keep-getting-an-error/m-p/255432#M57064</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-09T03:29:25Z</dc:date>
    </item>
  </channel>
</rss>

