<?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: How to modify this code to read the whole data in? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439832#M4703</link>
    <description>&lt;P&gt;Thank you it works.&lt;/P&gt;&lt;P&gt;But there is only 6 obs. in Temp C and temp F&lt;/P&gt;&lt;P&gt;why would this happen?&lt;/P&gt;&lt;PRE&gt;data temperature; 
infile '/folders/myfolders/Programs/tempArray.csv' dlm=',' dsd; 
input temperatureC 4.; 
temperatureF = temperatureC*(9/5)+32; 
run; 
 
proc print data=temperature; 
run; &lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Feb 2018 20:17:44 GMT</pubDate>
    <dc:creator>jc3992</dc:creator>
    <dc:date>2018-02-23T20:17:44Z</dc:date>
    <item>
      <title>How to modify this code to read the whole data in?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439809#M4700</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temperature;
infile '/folders/myfolders/Programs/tempArray.csv' dlm=',' dsd missover;
input temperatureC 2.1;
temperatureF = temperatureC*(9/5)+32;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I attached the original data and I wonder if anyone would like to give me some guide on how to read in the whole data?&lt;/P&gt;&lt;P&gt;The log did not show any errors but there is 120 data in it so my output is not correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks much!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 19:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439809#M4700</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-23T19:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify this code to read the whole data in?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439812#M4701</link>
      <description>&lt;P&gt;Are you trying to read all into one column? You have 24 columns but you've only listed one variable in the INPUT statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're unsure of the type/formats import it first using PROC IMPORT with GUESSINGROWS=MAX and then use the code from the log.&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/188695"&gt;@jc3992&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temperature;
infile '/folders/myfolders/Programs/tempArray.csv' dlm=',' dsd missover;
input temperatureC 2.1;
temperatureF = temperatureC*(9/5)+32;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I attached the original data and I wonder if anyone would like to give me some guide on how to read in the whole data?&lt;/P&gt;
&lt;P&gt;The log did not show any errors but there is 120 data in it so my output is not correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 19:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439812#M4701</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-23T19:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify this code to read the whole data in?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439827#M4702</link>
      <description>&lt;P&gt;The informat is incorrect:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input temperatureC 2.1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, it should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input temperatureC 4.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The width of 4 tells SAS to read 4 characters, and interpret whatever is there as a numeric value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions of 2.1 would not do the job.&amp;nbsp; That tells SAS to read only 2 characters, and if they contain no decimal point to assume that the last of those characters should be placed after the decimal point.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 20:13:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439827#M4702</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-23T20:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify this code to read the whole data in?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439832#M4703</link>
      <description>&lt;P&gt;Thank you it works.&lt;/P&gt;&lt;P&gt;But there is only 6 obs. in Temp C and temp F&lt;/P&gt;&lt;P&gt;why would this happen?&lt;/P&gt;&lt;PRE&gt;data temperature; 
infile '/folders/myfolders/Programs/tempArray.csv' dlm=',' dsd; 
input temperatureC 4.; 
temperatureF = temperatureC*(9/5)+32; 
run; 
 
proc print data=temperature; 
run; &lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2018 20:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439832#M4703</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-23T20:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify this code to read the whole data in?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439835#M4704</link>
      <description>&lt;P&gt;Because you have 24 variables and 5 rows of data, but your code is set up&amp;nbsp;to read one variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And since you didn't specify FIRSTOBS=2 it assumed the first row (header row) was data not a header.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 20:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439835#M4704</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-23T20:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify this code to read the whole data in?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439839#M4705</link>
      <description>&lt;P&gt;got you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I added a "@@" behind it would not work.&lt;/P&gt;&lt;PRE&gt;data temperature; 
infile '/folders/myfolders/Programs/tempArray.csv' dlm=',' dsd firstobs=2; 
input temperatureC 4.; 
temperatureF = temperatureC*(9/5)+32; 
run; 
 
proc print data=temperature; 
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2018 20:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439839#M4705</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-23T20:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify this code to read the whole data in?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439847#M4706</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;was brilliant to ask even what's your exact requirement as I am confused whether you seek clarification on how informats work or the right informats to apply or a code help to read your array data. If its the latter, here you go-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temperature;
infile 'C:\Users\NSRINIV2\Documents/tempArray.csv' dlm=',' dsd missover firstobs=2;
input temperatureC @;
do while(not missing(temperatureC));
temperatureF = temperatureC*(9/5)+32;
output;
input temperatureC @;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2018 20:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-modify-this-code-to-read-the-whole-data-in/m-p/439847#M4706</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-02-23T20:35:36Z</dc:date>
    </item>
  </channel>
</rss>

