<?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: data statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/data-statement/m-p/198806#M49676</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Niloo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly proive the sample raw data file which you want to import.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;VK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Aug 2015 20:49:55 GMT</pubDate>
    <dc:creator>varunk</dc:creator>
    <dc:date>2015-08-28T20:49:55Z</dc:date>
    <item>
      <title>data statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/data-statement/m-p/198805#M49675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to learn SAS using the videos on YouTube:&lt;A href="https://www.youtube.com/watch?v=4UaAlL7VwY0" title="https://www.youtube.com/watch?v=4UaAlL7VwY0"&gt;How to Use SAS - Lesson 3 - Importing External Data - YouTube&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;When I run the statement to import a text file I see the following warnings in the log:&lt;/P&gt;&lt;P&gt;114&amp;nbsp; data infile_main;&lt;/P&gt;&lt;P&gt;115&amp;nbsp; infile "C:\eventus\main.txt" LRECL=100 DLM=' ' firstobs=2;&lt;/P&gt;&lt;P&gt;116&amp;nbsp; input&lt;/P&gt;&lt;P&gt;117&amp;nbsp; x y z;&lt;/P&gt;&lt;P&gt;118&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;NOTE: The infile "C:\eventus\main.txt" is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=C:\eventus\main.txt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=100,File Size (bytes)=21,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Modified=13Aug2015:19:25:41,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Time=13Aug2015:19:25:38&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for x in line 2 1-5.&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for y in line 3 1-5.&lt;/P&gt;&lt;P&gt;NOTE: LOST CARD.&lt;/P&gt;&lt;P&gt;NOTE: Invalid data errors for file '"C:\eventus\main.txt"' occurred outside the printed range.&lt;/P&gt;&lt;P&gt;NOTE: Increase available buffer lines with the INFILE n= option.&lt;/P&gt;&lt;P&gt;x=. y=. z=. _ERROR_=1 _N_=1&lt;/P&gt;&lt;P&gt;NOTE: 2 records were read from the infile "C:\eventus\main.txt".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 5.&lt;/P&gt;&lt;P&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.INFILE_MAIN has 0 observations and 3 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.02 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are my statements:&lt;/P&gt;&lt;P&gt;data infile_main;&lt;/P&gt;&lt;P&gt;infile "C:\eventus\main.txt" LRECL=100 DLM=' ' firstobs=2;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;x y z;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;This is not the only time I have problem importing the data using data statements. I do not have any trouble importing the data using proc import or File&amp;gt;Import Data. Could you please tell me what is my mistake here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Niloo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2015 00:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/data-statement/m-p/198805#M49675</guid>
      <dc:creator>niloo</dc:creator>
      <dc:date>2015-08-14T00:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: data statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/data-statement/m-p/198806#M49676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Niloo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly proive the sample raw data file which you want to import.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;VK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 20:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/data-statement/m-p/198806#M49676</guid>
      <dc:creator>varunk</dc:creator>
      <dc:date>2015-08-28T20:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: data statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/data-statement/m-p/198807#M49677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you post some of the data I believe you will find that there are character values and possibly only one word or string of 5 characters.&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for x in line 2 1-5. means that you tried to read character data with a variable that was not declared to be character. You could use input x $ to say that x is supposed to contain character data or associate a character type informat prior to the input statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hint: When you see this&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;you tried to read more than was actually in the input file. The second hint is&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;NOTE: Invalid data for x in line 2 1-5.&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for y in line 3 1-5.&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;saying that the y value was attempting to read from the second line of the file and Z from the third line. AS indicated by&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;Run proc import against the same file and then look in the log for the program code generated. You will see significant differences.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 21:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/data-statement/m-p/198807#M49677</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-28T21:16:23Z</dc:date>
    </item>
  </channel>
</rss>

