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.
This is effectively a data crawler, detecting what data we have access to.
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.
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.
Is there a way to count the number of rows of a CAS table without loading it into memory?
This is the current code I use to check the number of rows in the table.
proc cas;
simple.numRows result=rows table={caslib="&caslib_name.",name="&table_name." } ;
call symputx("nrows",rows.numrows,"L");
quit;
Thanks for your help.