<?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: Double trailing Reading a long line in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490667#M128434</link>
    <description>&lt;P&gt;You are trying to read 10 values from a line that only has 9.&lt;/P&gt;
&lt;P&gt;Perhaps you should first read all of the values first and then later you regroup them into observations?&lt;/P&gt;
&lt;P&gt;Try something like this on your actual data an see if finds all of the values.&amp;nbsp; Then you can worry about figuring out which as the X and which are the Y.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  infile test dsd dlm=' ' ;
  row+1;
  input value @@ ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    row    value

 1      1       1
 2      2       2
 3      3       3
 4      4       4
 5      5       4
 6      6       5
 7      7       .
 8      8       5
 9      9       4&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Aug 2018 23:06:37 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-08-28T23:06:37Z</dc:date>
    <item>
      <title>Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490640#M128417</link>
      <description>&lt;P&gt;This is what i have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA B_1;&lt;BR /&gt;INFILE DATALINES ;&lt;BR /&gt;input x y&amp;nbsp; @@;&lt;BR /&gt;datalines;&lt;BR /&gt;1 2 3 4 4 5 &amp;nbsp;5&amp;nbsp;4&amp;nbsp;&amp;nbsp;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The row with the number&amp;nbsp;&lt;SPAN&gt;1 2 3 4 4 5 &amp;nbsp;5&amp;nbsp;4 .......................&amp;nbsp;&lt;/SPAN&gt; is very large . i just put a small numbers to make it easy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what i want&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:44:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490640#M128417</guid>
      <dc:creator>athapa1183</dc:creator>
      <dc:date>2018-08-28T21:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490643#M128418</link>
      <description>&lt;P&gt;Try adding the DSD option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;INFILE DATALINES  DSD;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/115177"&gt;@athapa1183&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This is what i have&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA B_1;&lt;BR /&gt;INFILE DATALINES ;&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/187967"&gt;@input&lt;/a&gt; x y&amp;nbsp; @@;&lt;BR /&gt;datalines;&lt;BR /&gt;1 2 3 4 4 5 &amp;nbsp;5&amp;nbsp;4&amp;nbsp;&amp;nbsp;&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The row with the number&amp;nbsp;&lt;SPAN&gt;1 2 3 4 4 5 &amp;nbsp;5&amp;nbsp;4 .......................&amp;nbsp;&lt;/SPAN&gt; is very large . i just put a small numbers to make it easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what i want&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;X&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:49:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490643#M128418</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-28T21:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490645#M128420</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DSD does not help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;417 DATA B_1;&lt;BR /&gt;418 INFILE DATALINES DSD;&lt;BR /&gt;419 input x y @@;&lt;BR /&gt;420 datalines;&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for x in line 421 1-16.&lt;BR /&gt;NOTE: LOST CARD.&lt;BR /&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--&lt;BR /&gt;422 ;&lt;BR /&gt;NOTE: Invalid data errors for file CARDS occurred outside the printed range.&lt;BR /&gt;NOTE: Increase available buffer lines with the INFILE n= option.&lt;BR /&gt;x=. y=. _ERROR_=1 _N_=1&lt;BR /&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;BR /&gt;NOTE: The data set WORK.B_1 has 0 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;422 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490645#M128420</guid>
      <dc:creator>athapa1183</dc:creator>
      <dc:date>2018-08-28T21:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490655#M128424</link>
      <description>&lt;P&gt;This gets the desired result:&lt;/P&gt;
&lt;PRE&gt;DATA work.B_1;
INFILE DATALINES  ;
input x  y   @@;
datalines;
1 2 3 4 4 5 . 5 4 .
;
run;&lt;/PRE&gt;
&lt;P&gt;A possibly somewhat random example such as this may not actually replicate your issue as datalines limit the use of certain options on the infile and change the behavior of others.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might help to provide an actual line of the data pasted into a code box opened with the {I}.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may also help to explicitly state that the issue seems to revolve around missing values at possibly random places in the actual data, if that is the case.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 22:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490655#M128424</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-28T22:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490659#M128427</link>
      <description>&lt;P&gt;I specified the delimiter as well, but it has trouble determining the end of&amp;nbsp;the data set then. For some reason it thinks it has 37 records now...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA B_1;
INFILE DATALINES dlm=' ' dsd;
input x y  @@;
datalines;
1 2 3 4 4 5  5 4
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;16999 DATA B_1;&lt;BR /&gt;17000 INFILE DATALINES dlm=' ' dsd;&lt;BR /&gt;17001 input x y @@;&lt;BR /&gt;17002 datalines;&lt;/P&gt;
&lt;P&gt;NOTE: LOST CARD.&lt;BR /&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;BR /&gt;17004 ;&lt;BR /&gt;x=. y=. _ERROR_=1 &lt;STRONG&gt;_N_=37&lt;/STRONG&gt;&lt;BR /&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;BR /&gt;NOTE: The data set WORK.B_1 has 36 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt; real time 0.00 seconds&lt;BR /&gt; cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;17004 ;&lt;BR /&gt;17005 run;&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>Tue, 28 Aug 2018 22:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490659#M128427</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-28T22:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490663#M128431</link>
      <description>&lt;P&gt;So if there is no value value then there is simply nothing in the data?&lt;/P&gt;
&lt;P&gt;The only way to spot the missing value is 2 spaces in a row?&lt;/P&gt;
&lt;P&gt;Is it always just one digit?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Comment:&lt;/P&gt;
&lt;P&gt;1. SAS will not accept a space as a missing numeric, so you need to read as character and parse&lt;/P&gt;
&lt;P&gt;2. The exact code depends on your answers&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 22:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490663#M128431</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-08-28T22:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490664#M128432</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I specified the delimiter as well, but it has trouble determining the end of&amp;nbsp;the data set then. For some reason it thinks it has 37 records now...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA B_1;
INFILE DATALINES dlm=' ' dsd;
input x y  @@;
datalines;
1 2 3 4 4 5  5 4
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;16999 DATA B_1;&lt;BR /&gt;17000 INFILE DATALINES dlm=' ' dsd;&lt;BR /&gt;@17001 input x y @@;&lt;BR /&gt;17002 datalines;&lt;/P&gt;
&lt;P&gt;NOTE: LOST CARD.&lt;BR /&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;BR /&gt;17004 ;&lt;BR /&gt;x=. y=. _ERROR_=1 &lt;STRONG&gt;_N_=37&lt;/STRONG&gt;&lt;BR /&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;BR /&gt;NOTE: The data set WORK.B_1 has 36 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt; real time 0.00 seconds&lt;BR /&gt; cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;17004 ;&lt;BR /&gt;17005 run;&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;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I think that is the datalines padding to 80 characters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;SAS handles data line length with the &lt;SPAN class="xis-xrefSee"&gt;&lt;A title="" href="http://127.0.0.1:52039/help/lesysoptsref.hlp/n0r48a3yh1ob57n153b8to8kuik0.htm" target="_blank"&gt;CARDIMAGE &lt;/A&gt;&lt;/SPAN&gt; system option. If you use CARDIMAGE, SAS processes data lines exactly like 80–byte punched card images padded with blanks. If you use NOCARDIMAGE, SAS processes data lines longer than 80 columns in their entirety.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(but still pads lines less than 80 to 80 with the NOCARDIMAGE option)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 28 Aug 2018 22:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490664#M128432</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-28T22:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490667#M128434</link>
      <description>&lt;P&gt;You are trying to read 10 values from a line that only has 9.&lt;/P&gt;
&lt;P&gt;Perhaps you should first read all of the values first and then later you regroup them into observations?&lt;/P&gt;
&lt;P&gt;Try something like this on your actual data an see if finds all of the values.&amp;nbsp; Then you can worry about figuring out which as the X and which are the Y.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  infile test dsd dlm=' ' ;
  row+1;
  input value @@ ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    row    value

 1      1       1
 2      2       2
 3      3       3
 4      4       4
 5      5       4
 6      6       5
 7      7       .
 8      8       5
 9      9       4&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 23:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490667#M128434</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-28T23:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490830#M128548</link>
      <description>&lt;P&gt;Thank You Reeza. yes there are more rows. But it works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 13:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490830#M128548</guid>
      <dc:creator>athapa1183</dc:creator>
      <dc:date>2018-08-29T13:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490831#M128549</link>
      <description>&lt;P&gt;Hi Ballardw,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are no dots here.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 13:28:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490831#M128549</guid>
      <dc:creator>athapa1183</dc:creator>
      <dc:date>2018-08-29T13:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Double trailing Reading a long line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490832#M128550</link>
      <description>&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 13:29:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Double-trailing-Reading-a-long-line/m-p/490832#M128550</guid>
      <dc:creator>athapa1183</dc:creator>
      <dc:date>2018-08-29T13:29:22Z</dc:date>
    </item>
  </channel>
</rss>

