<?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: Programmatically check LASR Table Status in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294788#M5195</link>
    <description>&lt;P&gt;I wrote a macro to do something similar. I wanted to check a table's load status and, if it is unloaded, fire a stored procedure that loads it. It's for reloading critical tables after a reboot, but you could adapt it for your needs. It uses the _T_TABLEMEMORY set in the LASR library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of checking a specific table you will want to filter down the loadedtables dataset and then iterate through the rows to fire your PROC CONTENTS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data loadedtables;
set VALIBLA._T_TABLEMEMORY;
run;

%macro ifunloaded(tablename, thescript);
	proc sql noprint;
		select count(*) into :OBSCOUNT from loadedtables where tablename = upper(&amp;amp;tablename) and uncompressedsize &amp;gt; 0;
	%if &amp;amp;OBscount = 0 %then %do;
		%put "&amp;amp;tablename is unloaded, we need to reload it";
		proc stp program=&amp;amp;thescript; 
		run;
		put "Table &amp;amp;tablename was unloaded and reload was attempted.";
		
	%end;
	%else %do;
		%put "&amp;amp;tablename is already loaded, leave it alone";
	%end;
%mend ifunloaded&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2016 13:24:55 GMT</pubDate>
    <dc:creator>mike2468</dc:creator>
    <dc:date>2016-08-29T13:24:55Z</dc:date>
    <item>
      <title>Programmatically check LASR Table Status</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294516#M5181</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been looking around the communities and Google today trying to find a way to do this but I havent been able to. I am new-ish to SAS programming so please bear with me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to write a program that automatically checks which tables are loaded in LASR and do a proc contents ONLY to the tables that are currently loaded.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked at Proc imstat, Proc SQL, Proc LASR to see if there is a way to check Load/Unload status on a LASR table but I am coming up empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a SAS Variable(either in dictionary or otherwise) that provides this information, and if so, which Proc would work best?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 19:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294516#M5181</guid>
      <dc:creator>eslna</dc:creator>
      <dc:date>2016-08-26T19:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically check LASR Table Status</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294586#M5182</link>
      <description>&lt;P&gt;Im not familiar with SAS Analytics, but I have the feeling that you might find answer or guide in the next link:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/vaug/65747/HTML/default/viewer.htm#p1ta97n7v64u6hn1adg3sobenfbz.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/vaug/65747/HTML/default/viewer.htm#p1ta97n7v64u6hn1adg3sobenfbz.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look also to the contents on left side of the page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using SAS BASE / SQL you can get all availabale tables and columns by:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; create table &amp;nbsp;u_name_it as select *&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from dictionary.columns;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to recognize LASR tables and distinguish them from others.&lt;/P&gt;&lt;P&gt;If you know add a WHERE statment to the SQL, to subset them only.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 15:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294586#M5182</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-08-27T15:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically check LASR Table Status</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294693#M5183</link>
      <description>&lt;P&gt;A great question and one I'd like to know the answer for too. I did a bit of searching and I think the answer is here in the special memory usage tables available for SAS VA:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/inmsref/68736/HTML/default/viewer.htm#p050lknh5xepngn1s2kaa5nijrer.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/inmsref/68736/HTML/default/viewer.htm#p050lknh5xepngn1s2kaa5nijrer.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 04:31:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294693#M5183</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-08-29T04:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically check LASR Table Status</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294788#M5195</link>
      <description>&lt;P&gt;I wrote a macro to do something similar. I wanted to check a table's load status and, if it is unloaded, fire a stored procedure that loads it. It's for reloading critical tables after a reboot, but you could adapt it for your needs. It uses the _T_TABLEMEMORY set in the LASR library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of checking a specific table you will want to filter down the loadedtables dataset and then iterate through the rows to fire your PROC CONTENTS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data loadedtables;
set VALIBLA._T_TABLEMEMORY;
run;

%macro ifunloaded(tablename, thescript);
	proc sql noprint;
		select count(*) into :OBSCOUNT from loadedtables where tablename = upper(&amp;amp;tablename) and uncompressedsize &amp;gt; 0;
	%if &amp;amp;OBscount = 0 %then %do;
		%put "&amp;amp;tablename is unloaded, we need to reload it";
		proc stp program=&amp;amp;thescript; 
		run;
		put "Table &amp;amp;tablename was unloaded and reload was attempted.";
		
	%end;
	%else %do;
		%put "&amp;amp;tablename is already loaded, leave it alone";
	%end;
%mend ifunloaded&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 13:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294788#M5195</guid>
      <dc:creator>mike2468</dc:creator>
      <dc:date>2016-08-29T13:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically check LASR Table Status</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294801#M5196</link>
      <description>&lt;P&gt;Thanks for the replies, will look into each and every one today and let you know which one worked best.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 13:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294801#M5196</guid>
      <dc:creator>eslna</dc:creator>
      <dc:date>2016-08-29T13:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically check LASR Table Status</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294903#M5204</link>
      <description>So you are basically checking if there are any observations first. That is very ingenious. I will keep it in mind. Will continue to research if there is an actual flag that can be surfaced via Base SAS code first though.</description>
      <pubDate>Mon, 29 Aug 2016 17:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294903#M5204</guid>
      <dc:creator>eslna</dc:creator>
      <dc:date>2016-08-29T17:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically check LASR Table Status</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294905#M5205</link>
      <description>&lt;P&gt;Dictionary.tables doesnt seem to have an attribute for Loaded/Unloaded status.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried Dictionary.columns it either makes my SAS Session unresponsive, or errors out when it tries to read an unloaded table.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 18:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Programmatically-check-LASR-Table-Status/m-p/294905#M5205</guid>
      <dc:creator>eslna</dc:creator>
      <dc:date>2016-08-29T18:01:06Z</dc:date>
    </item>
  </channel>
</rss>

