<?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: I cannot figure out what is causing the error message in my input statement in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244885#M158</link>
    <description>&lt;P&gt;Please also post lines 1-76 of your log. Most ERROR messages cannot be interpreted correctly without knowing what happened up to the moment the error occured.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2016 07:14:26 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-01-21T07:14:26Z</dc:date>
    <item>
      <title>I cannot figure out what is causing the error message in my input statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244883#M157</link>
      <description>&lt;P&gt;Can someone please let me know what is wrong with my code or advise me on an appropriate website where I can get help? &amp;nbsp;I am a beginner with SAS and I am taking a SAS programming class. &amp;nbsp;I am receiving the following error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;77&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT LOCATION $ 1 LENGTH 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _____&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 180&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;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;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%web_drop_table(WORK.IMPORT);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FILENAME REFFILE "/home/nkurek0/my_courses/pgross/mussels.xlsx" TERMSTR=CR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE=REFFILE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=XLSX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUT=WORK.IMPORT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC CONTENTS DATA=WORK.IMPORT; RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%web_open_table(WORK.IMPORT);&lt;/P&gt;&lt;P&gt;DATA MUSSELS; SET WORK.IMPORT;&amp;nbsp; RUN;&lt;/P&gt;&lt;P&gt;INPUT LOCATION $ 1 LENGTH 2; RUN;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=MUSSELS; RUN;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=MUSSELS; BY LOCATION; RUN;&lt;/P&gt;&lt;P&gt;PROC UNIVARIATE DATA=MUSSELS; By LOCATION; RUN;&lt;/P&gt;&lt;P&gt;PROC ANOVA DATA=MUSSELS;&lt;/P&gt;&lt;P&gt;CLASS LOCATION; MODEL LENGTH = LOCATION; RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 07:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244883#M157</guid>
      <dc:creator>nkurek0</dc:creator>
      <dc:date>2016-01-21T07:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot figure out what is causing the error message in my input statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244885#M158</link>
      <description>&lt;P&gt;Please also post lines 1-76 of your log. Most ERROR messages cannot be interpreted correctly without knowing what happened up to the moment the error occured.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 07:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244885#M158</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-21T07:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot figure out what is causing the error message in my input statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244886#M159</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;DATA MUSSELS; SET WORK.IMPORT;&amp;nbsp; &lt;STRONG&gt;RUN;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;INPUT LOCATION $ 1 LENGTH 2; RUN;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your INPUT statment should be part of DATA step, which mean should be inside the DATA step. But this is not happening here it is out the DATA step. So you are getting this error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you doing? What is the use of INPUT statment in your code?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 07:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244886#M159</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-21T07:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot figure out what is causing the error message in my input statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244888#M160</link>
      <description>&lt;P&gt;Ups. I see it in your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA MUSSELS; SET WORK.IMPORT;  RUN;
INPUT LOCATION $ 1 LENGTH 2; RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The RUN; terminates the data step, and puts the INPUT statement outside of the context of the data step. This causes the ERROR message.&lt;/P&gt;
&lt;P&gt;Omit the first RUN; to make the code syntactically correct.&lt;/P&gt;
&lt;P&gt;Your code is still semantically wrong, though.&lt;/P&gt;
&lt;P&gt;The INPUT statement is used to read data from external sources. In your step you already have a SAS dataset, so INPUT is not valid here (INPUT requires an INFILE or CARDS statement in the same data step).&lt;/P&gt;
&lt;P&gt;I guess you only want to have the variables (columns) location and length present in your data set. For this, you use the KEEP statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding programming style: you don't need to go all capitals; code is usually easier to read when capitals are used sparingly, or not at all.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 07:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244888#M160</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-21T07:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot figure out what is causing the error message in my input statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244892#M161</link>
      <description>&lt;P&gt;Thank you so much for your help! &amp;nbsp;I really appreciate it. &amp;nbsp;Have a good day.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 07:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244892#M161</guid>
      <dc:creator>nkurek0</dc:creator>
      <dc:date>2016-01-21T07:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot figure out what is causing the error message in my input statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244894#M162</link>
      <description>&lt;P&gt;Thank you for taking the time to respond to my question. &amp;nbsp;Another member of the SAS community already solved the issue. &amp;nbsp;It turns out that I was supposed to use a KEEP statement intsead of an INPUT statement. &amp;nbsp;Have a good day.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 07:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244894#M162</guid>
      <dc:creator>nkurek0</dc:creator>
      <dc:date>2016-01-21T07:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot figure out what is causing the error message in my input statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244908#M163</link>
      <description>&lt;P&gt;Could I ask what the reasoning behind the code formatting is. &amp;nbsp;You appear to have used every trick to make the code unreadable - all upper case, no consitent spacing,no new lines between code lines, and wrapping code unnecesarily in macro code. &amp;nbsp;A simple re-format will make your code look and read better, and highlight to you where these kind of problems occur:&lt;/P&gt;
&lt;PRE&gt;filename reffile "/home/nkurek0/my_courses/pgross/mussels.xlsx" termstr=cr;
 
proc import datafile=reffile
  dbms=xlsx
  out=work.import;
  getnames=yes;
run;
 
proc contents data=work.import; 
run;

/* What does this codeliine below do? */ 
%web_open_table(work.import);

data mussels;   
  set work.import;  
run;

/* This code line is the problem as not associated with anything */
  input location $ 1 length 2; run;

proc print data=mussels; 
run;

proc sort data=mussels; 
  by location; 
run;

proc univariate data=mussels; 
  by location; 
run;

proc anova data=mussels;
  class location; 
  model length = location; 
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jan 2016 09:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/I-cannot-figure-out-what-is-causing-the-error-message-in-my/m-p/244908#M163</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-21T09:46:32Z</dc:date>
    </item>
  </channel>
</rss>

