<?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 Viya 3.5 data in memory not available to all users in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Viya-3-5-data-in-memory-not-available-to-all-users/m-p/717111#M788</link>
    <description>&lt;P&gt;I have a process that appends new data to an in-memory table.&amp;nbsp; When I run the process and then query the table, I see the total number of rows including the rows just appended.&amp;nbsp; When teammates query the same table, they see only the pre-appended rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table was already promoted when the rows were appended.&amp;nbsp; If I put a proc casutil with promote after the append, I get an error saying the table is already promoted.&amp;nbsp; It&amp;nbsp;&lt;STRONG&gt;feels&lt;/STRONG&gt; like I need something like and UNpromote/REpromote, but I can't find any reference that describes such a process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 16:30:52 GMT</pubDate>
    <dc:creator>jaleone1</dc:creator>
    <dc:date>2021-02-05T16:30:52Z</dc:date>
    <item>
      <title>Viya 3.5 data in memory not available to all users</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Viya-3-5-data-in-memory-not-available-to-all-users/m-p/717111#M788</link>
      <description>&lt;P&gt;I have a process that appends new data to an in-memory table.&amp;nbsp; When I run the process and then query the table, I see the total number of rows including the rows just appended.&amp;nbsp; When teammates query the same table, they see only the pre-appended rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table was already promoted when the rows were appended.&amp;nbsp; If I put a proc casutil with promote after the append, I get an error saying the table is already promoted.&amp;nbsp; It&amp;nbsp;&lt;STRONG&gt;feels&lt;/STRONG&gt; like I need something like and UNpromote/REpromote, but I can't find any reference that describes such a process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 16:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Viya-3-5-data-in-memory-not-available-to-all-users/m-p/717111#M788</guid>
      <dc:creator>jaleone1</dc:creator>
      <dc:date>2021-02-05T16:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Viya 3.5 data in memory not available to all users</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Viya-3-5-data-in-memory-not-available-to-all-users/m-p/717169#M789</link>
      <description>&lt;P&gt;I did not find an effective solution to append tables directly in CAS.&amp;nbsp; I create a table in SPRE, drop the table in CAS (if it exists), and then promote it back.&amp;nbsp; we do this A LOT every hour.&amp;nbsp; so I have a nice auto call macro that handles a wide range of activities around updating data in CAS, but i plucked out a few macros that&lt;/P&gt;&lt;P&gt;might help you out.&amp;nbsp; i find them very useful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you end up invoking the %checkcasresult() macro by providing source table and target table information.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;good luck,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO UniformDelay();
	%PUT Insert Random Delay, Between 0 and 1 Second;

	DATA _null_;
		UniformDelay = rand('Uniform');
		rc=SLEEP(UniformDelay,1);
	RUN;
%MEND;

/* Macro for Dropping a Table from CAS */
%macro DropIt(name=);
proc casutil incaslib="public";
  droptable casdata="&amp;amp;name";   
/*   list files;                                      */
run; quit;
%mend;

/* Load table to CAS and Promt */
%macro LoadPromoteIt(name=);
proc casutil;              
   load data=work.&amp;amp;name outcaslib='public' promote ; 
   save casdata="&amp;amp;name" replace;
run; quit;
%mend;

/* Remove existing table from CAS if loaded already  */
%macro deleteCASdsifexists(lib,name);
    %if %sysfunc(exist(&amp;amp;lib..&amp;amp;name.)) %then %do;

		%put DeleteCASDSifExistsMacro;

		%DropIt(name=&amp;amp;name);

	%end;

	%if %sysfunc(exist(&amp;amp;lib..&amp;amp;name.)) %then %do;

		%put First Attempt Failed; Trying one more time;

		%UniformDelay();

		%DropIt(name=&amp;amp;name);

	%end;
%mend ;

%macro checkCASresult(Slib,Sname,Tlib,Tname,email);
	%PUT Source Data &amp;amp;Slib..&amp;amp;Sname.;
	%PUT Target Data &amp;amp;Tlib..&amp;amp;Tname ;
	%if %sysfunc(exist(&amp;amp;Slib..&amp;amp;Sname.)) %then %do;
		%put CheckResultMacro;

			%UniformDelay();

			%deleteCASdsifexists(&amp;amp;Tlib, &amp;amp;Tname);

			%UniformDelay();			
			%put loadTable;
			%LoadPromoteIt(name=&amp;amp;Sname);
	%end;	
	%else %do;
		%put table not there;
	%end;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Feb 2021 18:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Viya-3-5-data-in-memory-not-available-to-all-users/m-p/717169#M789</guid>
      <dc:creator>utrocketeng</dc:creator>
      <dc:date>2021-02-05T18:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Viya 3.5 data in memory not available to all users</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Viya-3-5-data-in-memory-not-available-to-all-users/m-p/717569#M792</link>
      <description>&lt;P&gt;To append data to an existing CAS table you can use a DATA Step together with the APPEND=YES data set option.&lt;/P&gt;
&lt;P&gt;Please be aware that the table to append, has to have the exact same structure as the existing table, so variable names, types, sequence all have to match. The CAS table is not automatically persisted, so the data is only added to the in memory part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially it looks like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data casuser.existing_data(append=yes);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Feb 2021 14:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Viya-3-5-data-in-memory-not-available-to-all-users/m-p/717569#M792</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2021-02-08T14:00:14Z</dc:date>
    </item>
  </channel>
</rss>

