<?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: Is _N_ available for PROC REPORT in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-N-available-for-PROC-REPORT/m-p/30553#M4603</link>
    <description>Thanks Cynthia.&lt;BR /&gt;
&lt;BR /&gt;
That's fantastic.</description>
    <pubDate>Tue, 09 Nov 2010 19:28:01 GMT</pubDate>
    <dc:creator>SanjayM</dc:creator>
    <dc:date>2010-11-09T19:28:01Z</dc:date>
    <item>
      <title>Is _N_ available for PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-N-available-for-PROC-REPORT/m-p/30551#M4601</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I want to print the report for a range of records i.e. for observation 10 to 20 and then 40 to 50, without modifying the source dataset to add _N_ as a column.&lt;BR /&gt;
&lt;BR /&gt;
Is _N_ available to PROC REPORT?&lt;BR /&gt;
&lt;BR /&gt;
Can you please suggest some other option without having the need to modify the source dataset.&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Sanjay</description>
      <pubDate>Mon, 08 Nov 2010 21:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-N-available-for-PROC-REPORT/m-p/30551#M4601</guid>
      <dc:creator>SanjayM</dc:creator>
      <dc:date>2010-11-08T21:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is _N_ available for PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-N-available-for-PROC-REPORT/m-p/30552#M4602</link>
      <description>Hi: &lt;BR /&gt;
  _N_ is only available as an automatic variable in a DATA step program. PROC PRINT has another (different) method for showing OBS number in it's output.&lt;BR /&gt;
 &lt;BR /&gt;
  The OBS= and FIRSTOBS= options allow you to select observations, however, you will need 1 step for OBS=10-20 and another step for obs 40-50, as shown in the program below. SASHELP.SHOES has 358 observations... I created an ORIGOBS column just to prove that FIRSTOBS and OBS worked.&lt;BR /&gt;
 &lt;BR /&gt;
  Do remember that if your input dataset somehow gets sorted that different observations might be selected in subsequent runs of your PROC REPORT code. Also, after using OBS= and FIRSTOBS= options, you will want to set the limit back to OBS=MAX and FIRSTOBS=1 so that subsequent procedures are not impacted by these options.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
options obs=max firstobs=1;&lt;BR /&gt;
data shoes;&lt;BR /&gt;
  set sashelp.shoes;&lt;BR /&gt;
  origobs = _n_;&lt;BR /&gt;
run;&lt;BR /&gt;
                  &lt;BR /&gt;
ods html file='c:\temp\useobs_firstobs.html' style=sasweb;&lt;BR /&gt;
options obs=10 firstobs=1;&lt;BR /&gt;
proc report data=shoes nowd;&lt;BR /&gt;
  title 'firstobs=1 obs=10';&lt;BR /&gt;
run;&lt;BR /&gt;
                     &lt;BR /&gt;
options obs=50 firstobs=40;&lt;BR /&gt;
proc report data=shoes nowd;&lt;BR /&gt;
  title 'firstobs=40 obs=50';&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
          &lt;BR /&gt;
options obs=max firstobs=1;&lt;BR /&gt;
[/pre]

** use this code to reset BOTH options:&lt;BR /&gt;
[pre]&lt;BR /&gt;
options obs=max firstobs=1;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Cynthia@sas</description>
      <pubDate>Tue, 09 Nov 2010 00:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-N-available-for-PROC-REPORT/m-p/30552#M4602</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-11-09T00:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is _N_ available for PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-N-available-for-PROC-REPORT/m-p/30553#M4603</link>
      <description>Thanks Cynthia.&lt;BR /&gt;
&lt;BR /&gt;
That's fantastic.</description>
      <pubDate>Tue, 09 Nov 2010 19:28:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-N-available-for-PROC-REPORT/m-p/30553#M4603</guid>
      <dc:creator>SanjayM</dc:creator>
      <dc:date>2010-11-09T19:28:01Z</dc:date>
    </item>
  </channel>
</rss>

