<?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: Problem on Input Statement in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/375680#M3000</link>
    <description>Thanks Reeza, Cynthia and art297 for the help.</description>
    <pubDate>Thu, 13 Jul 2017 13:27:22 GMT</pubDate>
    <dc:creator>potiu</dc:creator>
    <dc:date>2017-07-13T13:27:22Z</dc:date>
    <item>
      <title>Problem on Input Statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/374622#M2963</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem on Input statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the SAS code that I have run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10230iB292F0488160F95F/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="1.png" title="1.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result of the show in the log file is as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10231iFCCAAB365FCE9066/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="2.png" title="2.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I know where did I write wrongly for the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 17:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/374622#M2963</guid>
      <dc:creator>potiu</dc:creator>
      <dc:date>2017-07-10T17:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on Input Statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/374637#M2965</link>
      <description>&lt;P&gt;Where is the file stored and does it have an extension that you didn't include in specifying it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 18:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/374637#M2965</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-10T18:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on Input Statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/374666#M2967</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153220"&gt;@potiu&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a problem on Input statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the SAS code that I have run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10230iB292F0488160F95F/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="1.png" title="1.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result of the show in the log file is as follow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10231iFCCAAB365FCE9066/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="2.png" title="2.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I know where did I write wrongly for the code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I thought you had an Excel file? If so you should use PROC IMPORT not a data step. There's no definition of the file path in the code shown. Also, post these as text not as images.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 19:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/374666#M2967</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-10T19:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on Input Statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/374749#M2968</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; It appears that you are using SAS Studio. If you are reading a CSV comma-separated value file that you have stored in your shared folder location (/folders/myfolders) then I would expect to see an INFILE statement like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.cervicalcancer;
INFILE '/folders/myfolders/cervicalcancer.csv' dlm=',' dsd;
input var1 var2 var3 var4;
run;

proc print data=work.cervicalcancer;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or, if you are using SAS Studio with SAS OnDemand for Academics, then your INFILE statement might be something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;INFILE '/home/your_userid/mydata/cervicalcancer.csv' dlm=',' dsd;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but then the rest of the program would be the same. (as an example for CSV).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If you are reading an Excel file, then you might try the XLSX LIBNAME engine, but in that case, your syntax would be different:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mysheet xlsx '/folders/myfolders/cervicalcancer.xlsx';

data work.cervicalcancer;
  set mysheet.sheet1;
run;

proc contents data=work.cervicalcancer;
run;

proc print data=work.cervicalcancer;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And, again, if you are using SAS Studio with SAS OnDemand for Academics, then you need to upload your file to the SAS OnDemand server and change only your LIBNAME statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mysheet xlsx '/home/your_userid/mydata/cervicalcancer.xlsx';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then, you might also have to change the sheetname if you've named the sheet something other than SHEET1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Our free Programming 1 e-learning class has information on using the INFILE statement to read a CSV file and there are quite a few previous postings here in the Forum for using the XLSX Libname Engine to read Excel files such as a .XLSX file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I hope this helps explain that the technique you use to read the input file and the form of your INFILE and/or LIBNAME statement will depend on the type of file you are reading in (CSV vs XLSX).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 00:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/374749#M2968</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-07-11T00:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on Input Statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/375680#M3000</link>
      <description>Thanks Reeza, Cynthia and art297 for the help.</description>
      <pubDate>Thu, 13 Jul 2017 13:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-on-Input-Statement/m-p/375680#M3000</guid>
      <dc:creator>potiu</dc:creator>
      <dc:date>2017-07-13T13:27:22Z</dc:date>
    </item>
  </channel>
</rss>

