<?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 do I return the data on nth row of a dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-return-the-data-on-nth-row-of-a-dataset/m-p/919754#M362284</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/264750"&gt;@RandoDando&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The automatic variable _N_ counts DATA step iterations, so it's not available in a PROC step. But you can use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/ledsoptsref/p0wjxoxrco6dsgn1ls5n3mbybcng.htm" target="_blank" rel="noopener"&gt;FIRSTOBS=&lt;/A&gt; and &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/ledsoptsref/p0h5nwbig8mobbn1u0dwtdo0c0a0.htm" target="_blank" rel="noopener"&gt;OBS=&lt;/A&gt; dataset options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=have(firstobs=2385445 obs=2385445);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or, if you want to include two observations before and two after the row of interest:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=have(firstobs=2385443 obs=2385447);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Mar 2024 13:05:59 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2024-03-11T13:05:59Z</dc:date>
    <item>
      <title>How do I return the data on nth row of a dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-return-the-data-on-nth-row-of-a-dataset/m-p/919753#M362283</link>
      <description>&lt;P&gt;I have imported a data set which has warnings regarding some observations identified by row number.&amp;nbsp; I need to see what those are.&amp;nbsp; How do I run PROC PRINT with a WHERE condition to identify specific rows in the data set?&amp;nbsp; Where _n_ = 2385445 does not seem to work.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 12:59:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-return-the-data-on-nth-row-of-a-dataset/m-p/919753#M362283</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2024-03-11T12:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I return the data on nth row of a dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-return-the-data-on-nth-row-of-a-dataset/m-p/919754#M362284</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/264750"&gt;@RandoDando&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The automatic variable _N_ counts DATA step iterations, so it's not available in a PROC step. But you can use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/ledsoptsref/p0wjxoxrco6dsgn1ls5n3mbybcng.htm" target="_blank" rel="noopener"&gt;FIRSTOBS=&lt;/A&gt; and &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/ledsoptsref/p0h5nwbig8mobbn1u0dwtdo0c0a0.htm" target="_blank" rel="noopener"&gt;OBS=&lt;/A&gt; dataset options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=have(firstobs=2385445 obs=2385445);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or, if you want to include two observations before and two after the row of interest:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=have(firstobs=2385443 obs=2385447);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Mar 2024 13:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-return-the-data-on-nth-row-of-a-dataset/m-p/919754#M362284</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-03-11T13:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I return the data on nth row of a dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-return-the-data-on-nth-row-of-a-dataset/m-p/919766#M362287</link>
      <description>That worked! I wish there were a more straight-forward method, but it's easy enough.</description>
      <pubDate>Mon, 11 Mar 2024 14:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-return-the-data-on-nth-row-of-a-dataset/m-p/919766#M362287</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2024-03-11T14:22:26Z</dc:date>
    </item>
  </channel>
</rss>

