<?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: lose rows of data unexpectedly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437392#M108891</link>
    <description>&lt;P&gt;Read the log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="sasLogNote1_1515116096549" class="sasNote"&gt;&lt;STRONG&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV id="sasLogNote2_1515116096549" class="sasNote"&gt;NOTE: The data set WORK.AA00 has 10 observations and 1 variables.&lt;/DIV&gt;
&lt;DIV id="sasLogNote3_1515116096549" class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;When you specify $100 inline (on the INPUT statement) like that SAS is trying to find 100 characters. If you're trying to specify the variable length, try using a LENGTH or INFORMAT instead.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aa00;
informat name $100.;
input name;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 15 Feb 2018 01:13:15 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-15T01:13:15Z</dc:date>
    <item>
      <title>lose rows of data unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437381#M108887</link>
      <description>&lt;PRE&gt;data aa00;
input name $100.;
cards;
A20GE
ABSSVC
ADTPCLS
ADULTPED
AGEGP
APPTNO
AREANAME
BUCKET
BUSLIN
BUSLINE
BUSTYP
BUSTYPE
CLASSCD
CL_FAC
CL_MOB
CNTYNAME
CSANAME
DEDCT
DEP2CCIN
EDPFACID
;run;&lt;/PRE&gt;
&lt;P&gt;if I change $100. to $45. it will be ok. can anyone explain the magic in it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 00:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437381#M108887</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2018-02-15T00:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: lose rows of data unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437392#M108891</link>
      <description>&lt;P&gt;Read the log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="sasLogNote1_1515116096549" class="sasNote"&gt;&lt;STRONG&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV id="sasLogNote2_1515116096549" class="sasNote"&gt;NOTE: The data set WORK.AA00 has 10 observations and 1 variables.&lt;/DIV&gt;
&lt;DIV id="sasLogNote3_1515116096549" class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;When you specify $100 inline (on the INPUT statement) like that SAS is trying to find 100 characters. If you're trying to specify the variable length, try using a LENGTH or INFORMAT instead.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aa00;
informat name $100.;
input name;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Feb 2018 01:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437392#M108891</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-15T01:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: lose rows of data unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437394#M108892</link>
      <description>&lt;P&gt;&lt;A href="https://condenaststore.com/featured/then-dont-do-that-robert-leighton.html" target="_blank"&gt;https://condenaststore.com/featured/then-dont-do-that-robert-leighton.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your lines are 80 characters or less when you try to read 100 characters from them SAS will go to the next line to find enough characters.&lt;/P&gt;
&lt;P&gt;Either add an INFILE statement so that you can specify the TRUNCOVER option to prevent SAS from going to a new line,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aa00;
  infile cards truncover ;
  input name $100.;
cards;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or since you seem to want to read the whole line you could just use the _INFILE_ buffer.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aa00;
  length name $100 ;
  input;
  name = _infile_;
cards;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or don't use such a large informat. Note in-line data (CARDS/DATALINES) will have a LRECL that is a multiple of 80.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aa00;
  input name $80. ;
cards;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 01:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437394#M108892</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-02-15T01:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: lose rows of data unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437397#M108895</link>
      <description>&lt;P&gt;In my opinion you should ALWAYS set an explicit length for your character variables. If you don't you could end up with the same variable on different files having different lengths which could&amp;nbsp;lead to problems if you try to to append or merge them.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 01:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437397#M108895</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-02-15T01:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: lose rows of data unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437724#M109049</link>
      <description>&lt;P&gt;Thank you all so much !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also like the funny cartoon you shared with us.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 19:11:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/lose-rows-of-data-unexpectedly/m-p/437724#M109049</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2018-02-15T19:11:41Z</dc:date>
    </item>
  </channel>
</rss>

