<?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 Getting this error message: Statement is not valid or it is used out of proper order. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537898#M148019</link>
    <description>&lt;P&gt;Anyone know what's wrong with my code that I'm getting this error message in my log?:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15 PCE0 = PCE/6712.166667;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;116 RGAS = Price/PCE0;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have to find the real price of gas and I found the average price of my deflator in my excel file of the year 2000 which is my base year which turned out to be&amp;nbsp;6712.166667. I was given this code to use to create my new variable of the real price of gas but it's not working. I have never done this before so I'm not sure what to do. Here is my code getting the error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PCE0 = PCE/6712.166667;&lt;BR /&gt;RGAS = Price/PCE0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my full code:&lt;/P&gt;&lt;P&gt;ODS LISTING;&lt;BR /&gt;libname session1 "x";&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.one&lt;BR /&gt;DATAFILE="x"&lt;BR /&gt;DBMS=csv REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data= WORK.one;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc contents;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PCE0 = PCE/6712.166667;&lt;BR /&gt;RGAS = Price/PCE0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hid my pathway.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2019 22:21:32 GMT</pubDate>
    <dc:creator>khalillx</dc:creator>
    <dc:date>2019-02-22T22:21:32Z</dc:date>
    <item>
      <title>Getting this error message: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537898#M148019</link>
      <description>&lt;P&gt;Anyone know what's wrong with my code that I'm getting this error message in my log?:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15 PCE0 = PCE/6712.166667;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;116 RGAS = Price/PCE0;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have to find the real price of gas and I found the average price of my deflator in my excel file of the year 2000 which is my base year which turned out to be&amp;nbsp;6712.166667. I was given this code to use to create my new variable of the real price of gas but it's not working. I have never done this before so I'm not sure what to do. Here is my code getting the error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PCE0 = PCE/6712.166667;&lt;BR /&gt;RGAS = Price/PCE0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my full code:&lt;/P&gt;&lt;P&gt;ODS LISTING;&lt;BR /&gt;libname session1 "x";&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.one&lt;BR /&gt;DATAFILE="x"&lt;BR /&gt;DBMS=csv REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data= WORK.one;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc contents;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PCE0 = PCE/6712.166667;&lt;BR /&gt;RGAS = Price/PCE0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hid my pathway.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 22:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537898#M148019</guid>
      <dc:creator>khalillx</dc:creator>
      <dc:date>2019-02-22T22:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting this error message: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537901#M148020</link>
      <description>You have to post the full code and log, not just the error. That being said,  I'll bet the error is actually before that line, and is a missing semicolon again.</description>
      <pubDate>Fri, 22 Feb 2019 22:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537901#M148020</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-22T22:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Getting this error message: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537904#M148021</link>
      <description>You want my full log? That's a lot of information. I copied my code exactly from my professor so I doubt it's that.</description>
      <pubDate>Fri, 22 Feb 2019 22:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537904#M148021</guid>
      <dc:creator>khalillx</dc:creator>
      <dc:date>2019-02-22T22:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting this error message: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537907#M148023</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maxims of Maximally Efficient SAS Programmers&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;How to convert datasets to data steps&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The macro for direct download&lt;BR /&gt;&lt;A href="https://gist.githubusercontent.com/statgeek/bcc55940dd825a13b9c8ca40a904cba9/raw/865d2cf18f5150b8e887218dde0fc3951d0ff15b/data2datastep.sas" target="_blank"&gt;https://gist.githubusercontent.com/statgeek/bcc55940dd825a13b9c8ca40a904cba9/raw/865d2cf18f5150b8e887218dde0fc3951d0ff15b/data2datastep.sas&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;How to post code&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/help/faqpage/faq-category-id/posting#posting" target="_blank"&gt;https://communities.sas.com/t5/help/faqpage/faq-category-id/posting#posting&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 22:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537907#M148023</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-02-22T22:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting this error message: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537910#M148024</link>
      <description>&lt;P&gt;You can't access variables like that. To create a new variable it needs to be within a data step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're essentially creating new variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a video tutorial that covers the topic:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://video.sas.com/detail/videos/sas-analytics-u/video/4573023399001/creating-a-new-column-in-sas?autoStart=true&amp;amp;page=1" target="_blank"&gt;https://video.sas.com/detail/videos/sas-analytics-u/video/4573023399001/creating-a-new-column-in-sas?autoStart=true&amp;amp;page=1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, you need to provide enough code and the log for us to help you. Posting partial code hides the issues, especially when it's something as big as not using a data step.&amp;nbsp;&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/257791"&gt;@khalillx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Anyone know what's wrong with my code that I'm getting this error message in my log?:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;15 PCE0 = PCE/6712.166667;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;
&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;
&lt;P&gt;116 RGAS = Price/PCE0;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have to find the real price of gas and I found the average price of my deflator in my excel file of the year 2000 which is my base year which turned out to be&amp;nbsp;6712.166667. I was given this code to use to create my new variable of the real price of gas but it's not working. I have never done this before so I'm not sure what to do. Here is my code getting the error message:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PCE0 = PCE/6712.166667;&lt;BR /&gt;RGAS = Price/PCE0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my full code:&lt;/P&gt;
&lt;P&gt;ODS LISTING;&lt;BR /&gt;libname session1 "x";&lt;/P&gt;
&lt;P&gt;PROC IMPORT OUT= WORK.one&lt;BR /&gt;DATAFILE="x"&lt;BR /&gt;DBMS=csv REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc print data= WORK.one;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc contents;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;PCE0 = PCE/6712.166667;&lt;BR /&gt;RGAS = Price/PCE0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hid my pathway.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 22:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-this-error-message-Statement-is-not-valid-or-it-is-used/m-p/537910#M148024</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-22T22:37:24Z</dc:date>
    </item>
  </channel>
</rss>

