<?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: Statement is not valid or out of proper order. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789665#M252730</link>
    <description>I am using VDI and can not copy from that.</description>
    <pubDate>Wed, 12 Jan 2022 10:02:49 GMT</pubDate>
    <dc:creator>anandmgjsa</dc:creator>
    <dc:date>2022-01-12T10:02:49Z</dc:date>
    <item>
      <title>Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789636#M252706</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;My code is as below :&lt;/P&gt;&lt;P&gt;%macro pull_offer();&lt;/P&gt;&lt;P&gt;%let start_date = %sysfunc(mdy(1,1,2021));&lt;/P&gt;&lt;P&gt;%last_date = %sysfunc(mdy(1,5,2021));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%do date = &amp;amp;start_date to &amp;amp;end_date;&lt;/P&gt;&lt;P&gt;%let target_day = &amp;amp;date;&lt;/P&gt;&lt;P&gt;format target_day ddmmmyyyyn8.;&lt;/P&gt;&lt;P&gt;%put target_day;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql inobs = 10;&lt;/P&gt;&lt;P&gt;create table contact as&amp;nbsp;&lt;/P&gt;&lt;P&gt;select * from contact_master where mis_dt = &amp;amp;target_day;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let path = "temp/offer_data/test" || &amp;amp;target_day || ".csv";&lt;/P&gt;&lt;P&gt;%put path;&lt;/P&gt;&lt;P&gt;proc export data = contact;&lt;/P&gt;&lt;P&gt;outfile = &amp;amp;path;&lt;/P&gt;&lt;P&gt;dbms = csv;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend pull_offer;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%pull_offer;&lt;/P&gt;&lt;P&gt;Please help!!!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 05:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789636#M252706</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2022-01-12T05:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789637#M252707</link>
      <description>&lt;P&gt;The format statement is not valid outside of data steps and procedures. If the variable "mis_dt" is a sas date, formatting will raise other problems. If it is not a sas date, fix that issue first.&lt;/P&gt;
&lt;P&gt;The statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = "temp/offer_data/test" || &amp;amp;target_day || ".csv";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;won't work either, macro variable are all strings. So, you need:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = temp/offer_data/test&amp;amp;target_day..csv;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In proc export, you need to wrap the path in quotes.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 06:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789637#M252707</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-01-12T06:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789640#M252710</link>
      <description>&lt;P&gt;Hi Still i am getting error as path= or table= statement is required and must be specified...&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 06:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789640#M252710</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2022-01-12T06:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789649#M252718</link>
      <description>&lt;P&gt;All macro programming starts with working non-macro code.&lt;/P&gt;
&lt;P&gt;Run your SQL and EXPORT steps without&amp;nbsp;&lt;STRONG&gt;&lt;U&gt;any&lt;/U&gt;&lt;/STRONG&gt; macro coding (no use of macro variables!!), and show us the &lt;U&gt;complete&lt;/U&gt; log from that.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 08:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789649#M252718</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-12T08:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789653#M252721</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/380276"&gt;@anandmgjsa&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Outfile and dbms are both arguments to Proc Export, so don't use semicolons after first and second line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data = contact;
outfile = &amp;amp;path;
dbms = csv;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jan 2022 08:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789653#M252721</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2022-01-12T08:58:31Z</dc:date>
    </item>
    <item>
      <title>Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789656#M252732</link>
      <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anandmgjsa_0-1641977455366.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67339i3E2A259708C526B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anandmgjsa_0-1641977455366.png" alt="anandmgjsa_0-1641977455366.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anandmgjsa_2-1641978675493.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67341iBFCDB370B783671F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anandmgjsa_2-1641978675493.png" alt="anandmgjsa_2-1641978675493.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am getting sysntax error in %let path = statement&lt;/P&gt;&lt;P&gt;please help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789656#M252732</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2022-01-12T09:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789657#M252723</link>
      <description>I have removed this ;.&lt;BR /&gt;&lt;BR /&gt;But still i am getting error.</description>
      <pubDate>Wed, 12 Jan 2022 09:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789657#M252723</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2022-01-12T09:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789658#M252724</link>
      <description>the error is in %let path statement</description>
      <pubDate>Wed, 12 Jan 2022 09:14:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789658#M252724</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2022-01-12T09:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789664#M252729</link>
      <description>&lt;P&gt;Please post the &lt;EM&gt;complete&lt;/EM&gt; log. Copy/paste the log text into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789664#M252729</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-12T10:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789665#M252730</link>
      <description>I am using VDI and can not copy from that.</description>
      <pubDate>Wed, 12 Jan 2022 10:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789665#M252730</guid>
      <dc:creator>anandmgjsa</dc:creator>
      <dc:date>2022-01-12T10:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789666#M252733</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/380276"&gt;@anandmgjsa&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please share the full log by copying and pasting it into a post using the "&amp;lt;/&amp;gt;" (insert code) icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regqards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789666#M252733</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2022-01-12T10:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789667#M252734</link>
      <description>&lt;P&gt;I merged the questions dealing with the identical issue. Please do not double-post.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789667#M252734</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-12T10:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789668#M252735</link>
      <description>&lt;P&gt;Once again:&amp;nbsp;&lt;STRONG&gt;START WITH WORKING NON-MACRO CODE!!!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Once that works, you can make it dynamic, but before the code works without macro coding, your efforts will be futile.&lt;/P&gt;
&lt;P&gt;The OUTFILE= option in the PROC EXPORT statement needs a string with a physical path (enclosed in quotes) or a file reference (without quotes).&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:23:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789668#M252735</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-12T10:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789671#M252738</link>
      <description>&lt;P&gt;I see one problem, but that is in proc export: you need to enclose &amp;amp;path in quotes.&lt;/P&gt;
&lt;P&gt;If this doesn't solve the problem, remove all macro code and solve all problem, as has be recommended by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; multiple times.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:36:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789671#M252738</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-01-12T10:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789768#M252769</link>
      <description>&lt;P&gt;Make sure that any sort of directory Path variable starts at a drive (Windows) or disk mount point that is accessible from the machine running SAS. If you do not start at the drive/mount level then the path is a relative and will attempt to find things relative to the current "default" location which may well be in the SAS executable folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a server install then the path will be relative to the server, not your machine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This in addition to the need for Outfile="&amp;amp;path." to properly use it in the Proc Export code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/380276"&gt;@anandmgjsa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anandmgjsa_0-1641977455366.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67339i3E2A259708C526B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anandmgjsa_0-1641977455366.png" alt="anandmgjsa_0-1641977455366.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anandmgjsa_2-1641978675493.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67341iBFCDB370B783671F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anandmgjsa_2-1641978675493.png" alt="anandmgjsa_2-1641978675493.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I am getting sysntax error in %let path = statement&lt;/P&gt;
&lt;P&gt;please help!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 17:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Statement-is-not-valid-or-out-of-proper-order/m-p/789768#M252769</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-12T17:51:06Z</dc:date>
    </item>
  </channel>
</rss>

