<?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: read data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/read-data/m-p/66101#M18851</link>
    <description>It depends on how your data is stored.  If it is in a dataset, you want the "obs = 2" dataset option.&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
  set sashelp.shoes(obs = 2);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
If you are reading a file, the you could use the _n_ automatic variable;&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
  input num var1 var2 var3;&lt;BR /&gt;
  if _n_ &amp;gt; 2 then stop;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 2 3 4 &lt;BR /&gt;
2 12 13 14&lt;BR /&gt;
1 2 3 4 &lt;BR /&gt;
2 12 13 14&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Curtis</description>
    <pubDate>Wed, 26 Jan 2011 21:01:11 GMT</pubDate>
    <dc:creator>CurtisMack</dc:creator>
    <dc:date>2011-01-26T21:01:11Z</dc:date>
    <item>
      <title>read data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/read-data/m-p/66100#M18850</link>
      <description>hi,&lt;BR /&gt;
I have a data set with repeating data &lt;BR /&gt;
Ex:&lt;BR /&gt;
num var1 var2 var3&lt;BR /&gt;
1        2         3      4 &lt;BR /&gt;
2      12      13    14&lt;BR /&gt;
1        2         3      4 &lt;BR /&gt;
2      12      13    14&lt;BR /&gt;
&lt;BR /&gt;
I just need the first 2 lines. How do I tell SAS read the first two line only.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
thanks</description>
      <pubDate>Wed, 26 Jan 2011 20:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/read-data/m-p/66100#M18850</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-01-26T20:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: read data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/read-data/m-p/66101#M18851</link>
      <description>It depends on how your data is stored.  If it is in a dataset, you want the "obs = 2" dataset option.&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
  set sashelp.shoes(obs = 2);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
If you are reading a file, the you could use the _n_ automatic variable;&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
  input num var1 var2 var3;&lt;BR /&gt;
  if _n_ &amp;gt; 2 then stop;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 2 3 4 &lt;BR /&gt;
2 12 13 14&lt;BR /&gt;
1 2 3 4 &lt;BR /&gt;
2 12 13 14&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Curtis</description>
      <pubDate>Wed, 26 Jan 2011 21:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/read-data/m-p/66101#M18851</guid>
      <dc:creator>CurtisMack</dc:creator>
      <dc:date>2011-01-26T21:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: read data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/read-data/m-p/66102#M18852</link>
      <description>Thank you&lt;BR /&gt;
It worked</description>
      <pubDate>Wed, 26 Jan 2011 21:17:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/read-data/m-p/66102#M18852</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-01-26T21:17:17Z</dc:date>
    </item>
  </channel>
</rss>

