<?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 it possible to count the number of rows in a dataset in CAS without loading the table? in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Is-it-possible-to-count-the-number-of-rows-in-a-dataset-in-CAS/m-p/884327#M1902</link>
    <description>&lt;P&gt;Thanks for helping me clarify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most of the caslibs are actually connections to Oracle databases.&lt;BR /&gt;&lt;BR /&gt;Which makes me think that I should potentially explore using directly querying the Oracle database for any information it holds on the tables, rather than accessing it via the caslib connector?&lt;BR /&gt;As presumably, SAS will struggle to operate on the tables without loading them first, as they're not currently SAS datasets.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jul 2023 12:29:47 GMT</pubDate>
    <dc:creator>shiney_martin1</dc:creator>
    <dc:date>2023-07-11T12:29:47Z</dc:date>
    <item>
      <title>Is it possible to count the number of rows in a dataset in CAS without loading the table?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Is-it-possible-to-count-the-number-of-rows-in-a-dataset-in-CAS/m-p/884294#M1900</link>
      <description>&lt;P&gt;I am writing a program which will detect all the tables, and the columns in each of these tables, in multiple caslibs my program has access to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is effectively a data crawler, detecting what data we have access to.&amp;nbsp;&lt;BR /&gt;However, there is a problem that some of these tables are empty, so I don't want to have them listed in the final output, as these tables are not useful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the solution is that as I go through the tables, I would like to check the number of rows, however I can only find solutions that load the table, then checks the number of rows. This is problematic as the program has access to thousands of tables, and some of them are hundreds of millions of rows, so take 20+ minutes to load. So the overall data crawler would take over a day to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to count the number of rows of a CAS table without loading it into memory?&lt;BR /&gt;&lt;BR /&gt;This is the current code I use to check the number of rows in the table.&lt;/P&gt;&lt;PRE&gt;	proc cas;
  	    simple.numRows result=rows  table={caslib="&amp;amp;caslib_name.",name="&amp;amp;table_name." } ; 
	    call symputx("nrows",rows.numrows,"L");
	quit;&lt;/PRE&gt;&lt;P&gt;Thanks for your help.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 09:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Is-it-possible-to-count-the-number-of-rows-in-a-dataset-in-CAS/m-p/884294#M1900</guid>
      <dc:creator>shiney_martin1</dc:creator>
      <dc:date>2023-07-11T09:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to count the number of rows in a dataset in CAS without loading the table?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Is-it-possible-to-count-the-number-of-rows-in-a-dataset-in-CAS/m-p/884308#M1901</link>
      <description>&lt;P&gt;Good question! (I don't have the answer&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For clarity,&lt;/P&gt;
&lt;P&gt;y&lt;SPAN&gt;ou have SAS-tables saved as *.SASHDAT (in-memory format) files in several&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;path-based caslibs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now you want to check the n° of records (n° of observations) in the *.sashdat data sets without uploading to memory first ... Correct?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Not sure whether it's possible, but I guess other people will chime in to explain more.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 11:26:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Is-it-possible-to-count-the-number-of-rows-in-a-dataset-in-CAS/m-p/884308#M1901</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-07-11T11:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to count the number of rows in a dataset in CAS without loading the table?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Is-it-possible-to-count-the-number-of-rows-in-a-dataset-in-CAS/m-p/884327#M1902</link>
      <description>&lt;P&gt;Thanks for helping me clarify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most of the caslibs are actually connections to Oracle databases.&lt;BR /&gt;&lt;BR /&gt;Which makes me think that I should potentially explore using directly querying the Oracle database for any information it holds on the tables, rather than accessing it via the caslib connector?&lt;BR /&gt;As presumably, SAS will struggle to operate on the tables without loading them first, as they're not currently SAS datasets.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 12:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Is-it-possible-to-count-the-number-of-rows-in-a-dataset-in-CAS/m-p/884327#M1902</guid>
      <dc:creator>shiney_martin1</dc:creator>
      <dc:date>2023-07-11T12:29:47Z</dc:date>
    </item>
  </channel>
</rss>

