<?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 Re: ERROR 180-322: Statement is not valid or it is used out of proper order. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559526#M156246</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;Thank you very much but my problem remains... I double checked the file, the data file property shows that it's an xls file. I even tried convert it into a csv and an xml file. Neither one works when I tried to import them into SAS...&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2019 00:40:21 GMT</pubDate>
    <dc:creator>kegong</dc:creator>
    <dc:date>2019-05-17T00:40:21Z</dc:date>
    <item>
      <title>ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559368#M156179</link>
      <description>&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received this error 180-322 message while I was trying to run below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.FISCAL&lt;BR /&gt;DATAFILE= "D:\Summer 2019 Work\Summer19\Ke Summer Data"&lt;BR /&gt;DBMS= XLS;&lt;BR /&gt;RANGE="Sheet1$";&lt;BR /&gt;GETNAMES=YES;&lt;BR /&gt;MIXED=NO;&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;SCANTIME=YES;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is the detailed error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 PROC IMPORT OUT= WORK.FISCAL&lt;BR /&gt;2 DATAFILE= "D:\Summer 2019 Work\Summer19\Ke Summer Data"&lt;BR /&gt;3 DBMS= XLS;&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;4 RANGE="Sheet1$";&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;5 GETNAMES=YES;&lt;BR /&gt;6 MIXED=NO;&lt;BR /&gt;7 SCANTEXT=YES;&lt;BR /&gt;--------&lt;BR /&gt;180&lt;BR /&gt;8 USEDATE=YES;&lt;BR /&gt;-------&lt;BR /&gt;180&lt;BR /&gt;9 SCANTIME=YES;&lt;BR /&gt;--------&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: 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'm not sure what happened. Could someone please help me out? Thanks very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 15:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559368#M156179</guid>
      <dc:creator>kegong</dc:creator>
      <dc:date>2019-05-16T15:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559394#M156192</link>
      <description>&lt;P&gt;Maybe try DBMS=EXCEL instead? I couldn't find any documentation on DBMS=XLS that had all of the options you listed. See&amp;nbsp;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=acpcref&amp;amp;docsetTarget=n0msy4hy1so0ren1acm90iijxn8j.htm&amp;amp;locale=en" target="_blank"&gt;https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=acpcref&amp;amp;docsetTarget=n0msy4hy1so0ren1acm90iijxn8j.htm&amp;amp;locale=en&lt;/A&gt; for more documentation.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 16:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559394#M156192</guid>
      <dc:creator>stechafle</dc:creator>
      <dc:date>2019-05-16T16:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559493#M156228</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/242844"&gt;@stechafle&lt;/a&gt; Thanks a lot for your reply! Below is what I originally used:&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT OUT= WORK.FISCAL&lt;BR /&gt;DATAFILE= "D:\Summer 2019 Work\Summer19\Ke Summer Data"&lt;BR /&gt;DBMS=EXCEL REPLACE;&lt;BR /&gt;&lt;BR /&gt;But then I got another error message for running this.&lt;BR /&gt;&lt;BR /&gt;ERROR: Connect: Class not registered&lt;BR /&gt;ERROR: Error in the LIBNAME statement.&lt;BR /&gt;ERROR: Connection Failed. See log for details&lt;BR /&gt;&lt;BR /&gt;Seems like this error happens when importing 32-bit excel file to a 64-bit SAS.But my Office 365 is already 64-bit. So I'm totaly confused...</description>
      <pubDate>Thu, 16 May 2019 21:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559493#M156228</guid>
      <dc:creator>kegong</dc:creator>
      <dc:date>2019-05-16T21:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559506#M156237</link>
      <description>&lt;P&gt;How about showing the actual entire name of the data file???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATAFILE= "D:\Summer 2019 Work\Summer19\Ke Summer Data" is sort of incomplete from&amp;nbsp;many purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may also have to check to see if someone "lied" to Excel. You will find people that create files as HTML, XML or even CSV but name the file with XLS or extension so Excel will be the default program to open the file. Any of those will likely fail to import.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or try doing a FILE SAVE AS from Excel to a CSV format and import that.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 22:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559506#M156237</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-16T22:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559526#M156246</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;Thank you very much but my problem remains... I double checked the file, the data file property shows that it's an xls file. I even tried convert it into a csv and an xml file. Neither one works when I tried to import them into SAS...&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 00:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559526#M156246</guid>
      <dc:creator>kegong</dc:creator>
      <dc:date>2019-05-17T00:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559534#M156252</link>
      <description>&lt;P&gt;Why don't you specify the proper file name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATAFILE= "D:\Summer 2019 Work\Summer19\Ke Summer Data.&lt;STRONG&gt;xls&lt;/STRONG&gt;"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 02:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559534#M156252</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-05-17T02:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559538#M156254</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;Thanks a lot for your help. I added xls to the file name but the problem remains. But it worked when I saved the xls file as a csv file and deleted below rows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RANGE="Sheet1$";&lt;/P&gt;&lt;P&gt;MIXED=NO;&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;SCANTIME=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now I'm using this and it works out well:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.FISCAL&lt;BR /&gt;DATAFILE= "D:\OD - Copy\Research Projects\Dr. Johnson\CEO effect\Summer 2019 Work\Summer19\Ke_Summer_Data.csv"&lt;BR /&gt;DBMS=CSV REPLACE; GETNAMES=YES;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm not sure whether deleting the setting of date format etc damaged the dataset...&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 02:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559538#M156254</guid>
      <dc:creator>kegong</dc:creator>
      <dc:date>2019-05-17T02:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559550#M156259</link>
      <description>&lt;P&gt;Can't comment further without seeing more code, but the messages you were seeing relate to invalid/incompatible values for the different options chosen (DBMS=&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;SCANTEXT=&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;USEDATE=&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;SCANTIME=&amp;nbsp; etc). Not all engines use all options.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 03:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559550#M156259</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-05-17T03:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559553#M156261</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;Thanks again for clarifying. I think the data imported to SAS is good. So I'll go with the reduced code. Have a nice weekend!&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 03:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559553#M156261</guid>
      <dc:creator>kegong</dc:creator>
      <dc:date>2019-05-17T03:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559717#M156352</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/274428"&gt;@kegong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;Thanks a lot for your help. I added xls to the file name but the problem remains. But it worked when I saved the xls file as a csv file and deleted below rows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RANGE="Sheet1$";&lt;/P&gt;
&lt;P&gt;MIXED=NO;&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;SCANTIME=YES;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So now I'm using this and it works out well:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC IMPORT OUT= WORK.FISCAL&lt;BR /&gt;DATAFILE= "D:\OD - Copy\Research Projects\Dr. Johnson\CEO effect\Summer 2019 Work\Summer19\Ke_Summer_Data.csv"&lt;BR /&gt;DBMS=CSV REPLACE; GETNAMES=YES;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'm not sure whether deleting the setting of date format etc damaged the dataset...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suggest also using GUESSINGROWS=MAX; This option, &lt;STRONG&gt;not available&lt;/STRONG&gt; for XLS, XLSX and many database formats, works with delimited text such as CSV to examine the entire dataset before guessing as the variable type and length. SCANTEXT is somewhat similar in purpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But do look at the data step code generated to ensure the variables are read as needed.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 16:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559717#M156352</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-17T16:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 180-322: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559720#M156354</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;Thank you so much. It works pretty well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 16:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-180-322-Statement-is-not-valid-or-it-is-used-out-of-proper/m-p/559720#M156354</guid>
      <dc:creator>kegong</dc:creator>
      <dc:date>2019-05-17T16:55:13Z</dc:date>
    </item>
  </channel>
</rss>

