<?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: Promotion already exits when uploading a dataset to CAS in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897990#M2042</link>
    <description>&lt;P&gt;&lt;SPAN&gt;The ERROR you are seeing indicates that you are attempting to load and promote data to a CAS-table that already exists.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A global table cannot be replaced.&amp;nbsp;&amp;nbsp;It must be dropped first and then recreated.&amp;nbsp;&amp;nbsp;You can add the DROPTABLE statement to your PROC CASUTIL code.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The below statement will drop the table if it already exists. &lt;BR /&gt;Suppose ABC_XYZ_STATISTICS is in PUBLIC CASLIB, the example code then looks like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;droptable casdata='ABC_XYZ_STATISTICS' incaslib='public' quiet;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Also, it's possible that the DROPTABLE step is not 100% finished before the second / next steps starts execution.&amp;nbsp;&amp;nbsp; In cases like these, the problem can be resolved by pausing execution between steps.&amp;nbsp;&amp;nbsp; This can be done using the SLEEP function.&amp;nbsp;&amp;nbsp;Try adding the following DATA _null_ step in between the PROC CASUTIL that drops the table and the one that loads it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* this code will cause your system to 'sleep' for 90 seconds */
data _null_;
&amp;nbsp;&amp;nbsp;&amp;nbsp;x=sleep(90);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2023 16:52:12 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2023-10-10T16:52:12Z</dc:date>
    <item>
      <title>Promotion already exits when uploading a dataset to CAS</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897841#M2039</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This has been an annoying issue I've had with Viya for over a year now. I resolve it by logging out and logging back in, but I wonder if there is a better method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When uploading a dataset in SAS Studio to CAS for use within Visual Analytics, I often receive a message similar to:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Promotion already exists, please try under a different name"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This usually happens when I adjust a part of the code and re-run the process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no rhyme or reason why this happens as far as I can tell. Some of my programs re-run multiple time and rewrite to CAS with no problem, others receive this error. Both use the same CAS server, process, macros, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas how to limit this annoyance going forward?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 17:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897841#M2039</guid>
      <dc:creator>illmatic</dc:creator>
      <dc:date>2023-10-09T17:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Promotion already exits when uploading a dataset to CAS</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897924#M2040</link>
      <description>Maybe you try a suggestion from the thread: &lt;A href="https://communities.sas.com/t5/SAS-Programming/Promote-a-session-scope-table-to-global-scope/td-p/882976" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Promote-a-session-scope-table-to-global-scope/td-p/882976&lt;/A&gt; or &lt;A href="https://communities.sas.com/t5/SAS-Viya/Global-Table-cannot-be-replaced/td-p/445125" target="_blank"&gt;https://communities.sas.com/t5/SAS-Viya/Global-Table-cannot-be-replaced/td-p/445125&lt;/A&gt;</description>
      <pubDate>Tue, 10 Oct 2023 08:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897924#M2040</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-10-10T08:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Promotion already exits when uploading a dataset to CAS</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897988#M2041</link>
      <description>Thanks Josvander, but unfortunately the original poster's issue was not resolved when they mentioned the same issue I am having. I believe it to be a SAS Viya bug as sometimes this message stops a promotion and sometimes it doesn't with no change in code.</description>
      <pubDate>Tue, 10 Oct 2023 16:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897988#M2041</guid>
      <dc:creator>illmatic</dc:creator>
      <dc:date>2023-10-10T16:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Promotion already exits when uploading a dataset to CAS</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897990#M2042</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The ERROR you are seeing indicates that you are attempting to load and promote data to a CAS-table that already exists.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A global table cannot be replaced.&amp;nbsp;&amp;nbsp;It must be dropped first and then recreated.&amp;nbsp;&amp;nbsp;You can add the DROPTABLE statement to your PROC CASUTIL code.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The below statement will drop the table if it already exists. &lt;BR /&gt;Suppose ABC_XYZ_STATISTICS is in PUBLIC CASLIB, the example code then looks like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;droptable casdata='ABC_XYZ_STATISTICS' incaslib='public' quiet;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Also, it's possible that the DROPTABLE step is not 100% finished before the second / next steps starts execution.&amp;nbsp;&amp;nbsp; In cases like these, the problem can be resolved by pausing execution between steps.&amp;nbsp;&amp;nbsp; This can be done using the SLEEP function.&amp;nbsp;&amp;nbsp;Try adding the following DATA _null_ step in between the PROC CASUTIL that drops the table and the one that loads it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* this code will cause your system to 'sleep' for 90 seconds */
data _null_;
&amp;nbsp;&amp;nbsp;&amp;nbsp;x=sleep(90);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 16:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Promotion-already-exits-when-uploading-a-dataset-to-CAS/m-p/897990#M2042</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-10T16:52:12Z</dc:date>
    </item>
  </channel>
</rss>

