<?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: row count with nobs in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214170#M52781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;thanks for the answer.&lt;/P&gt;&lt;P&gt;The data does come from proc sql but I create a SAS data set for further interaction like client side sorting, filtering, styling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; connect to oracle as nrkpdb (user=xxx password=yyyy path=Dxxx);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table positivlist as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from connection to nrkpdb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT* from dual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; disconnect from nrkpdb;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Apr 2015 09:40:33 GMT</pubDate>
    <dc:creator>metallon</dc:creator>
    <dc:date>2015-04-01T09:40:33Z</dc:date>
    <item>
      <title>row count with nobs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214168#M52779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I spent a few hours with google and found nothing shorter than the following to get the row count:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let dsid=%sysfunc(open(mydataSet));&lt;/P&gt;&lt;P&gt;%let num=%sysfunc(attrn(&amp;amp;dsid,nlobs));&lt;/P&gt;&lt;P&gt;%let rc=%sysfunc(close(&amp;amp;dsid));&lt;/P&gt;&lt;P&gt;%put There are &amp;amp;num observations in dataset one;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a quicker way? the variable &amp;amp;num appears later in a proc report title.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 08:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214168#M52779</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2015-04-01T08:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: row count with nobs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214169#M52780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This only works with SAS-dataset not with external DBMS-tables. With SAS datasets it is the fastest and direct approach.&lt;/P&gt;&lt;P&gt;It depends on your logical needs if this is the most handy approach. &lt;BR /&gt;1/ The open attrn close are SAS functions. You can use them in a SAS-datastep&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is the quickest one when working with a dataset that should contain those retrieved information.&amp;nbsp; (avoid overhead&amp;nbsp; macro interaction)&lt;/P&gt;&lt;P&gt;2/ Having working on a dataset you have firs/last processing at that moment knowing those numbers and may be stored.&lt;/P&gt;&lt;P&gt;3/ &lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm"&gt;SAS(R) 9.4 Statements: Reference, Third Edition&lt;/A&gt; Set is having curobs and nobs as options. Very valuable&amp;nbsp; when processing the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take care as the number is having the count included of records marked as being deleted.(modify result)&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 08:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214169#M52780</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T08:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: row count with nobs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214170#M52781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;thanks for the answer.&lt;/P&gt;&lt;P&gt;The data does come from proc sql but I create a SAS data set for further interaction like client side sorting, filtering, styling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; connect to oracle as nrkpdb (user=xxx password=yyyy path=Dxxx);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table positivlist as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from connection to nrkpdb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT* from dual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; disconnect from nrkpdb;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 09:40:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214170#M52781</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2015-04-01T09:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: row count with nobs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214171#M52782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;metallon,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For an external DBMS the Sql count(*) is a common exception retrieving information.&lt;/P&gt;&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/ms175997.aspx" title="https://msdn.microsoft.com/en-us/library/ms175997.aspx"&gt;COUNT (Transact-SQL)&lt;/A&gt; (MS SQL)&lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions032.htm" title="http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions032.htm"&gt;COUNT&lt;/A&gt; (Oracle SQL)&lt;BR /&gt;What I can and allowed to do is the DBMS optimization possible an active dictionary on those side. Nothing beats that one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With bigger data (above several GB's these days) is often more profitable to use data federation techniques or in database processing. ( prod ds2 ,&amp;nbsp; FED SQL).&lt;BR /&gt;Leaving the data as long as possible at the DBMS side doing the work there. Only at the moment of reporting/analyses getting it to SAS.&lt;BR /&gt;Filtering and sorting are tasks that can be done by a well&amp;nbsp; performing DBMS better. When the DBMS design is a bad one and there is no way top get that optimized you are better with a copied version with SAS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is all up to you to analyze the situation and decide accordingly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 12:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/row-count-with-nobs/m-p/214171#M52782</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T12:32:30Z</dc:date>
    </item>
  </channel>
</rss>

