<?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 Proc Export - Error: String is duplicated in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356009#M83420</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an export step&amp;nbsp;at the end of my code which exports to a excel document on a specific sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Within that excel doc there is a second sheet which links to this data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I initially run (and on most subsequent runs) it all works fine however sometimes when I run I get an error message saying "Error: String is duplicated" plus some symbols in brackets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I get this error message it seems to still export data but also corrupts the excel file. I can go into the excel file but column names have moved, formats changed etc which shouldn't happen.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know what this error message means and how to fix the issue. Odd how it only happens sometimes (though seems to happen more often if I run the full script rather than bit by bit). Code is below. Currently I am only testing it for one client but eventually this will be rolled out to run across multiple clients. I use SAS Studio but don't think this is important for this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro Export (i,j);&lt;BR /&gt;data &amp;amp;j._output;&lt;BR /&gt; set summary ; &lt;BR /&gt; where Client_name = "&amp;amp;i.";&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC EXPORT DATA= WORK.&amp;amp;j._output&lt;BR /&gt; OUTFILE= "\\&amp;lt;file location&amp;gt;\&amp;amp;i..xlsx" &lt;BR /&gt; DBMS=xlsx&lt;BR /&gt; REPLACE;&lt;BR /&gt; SHEET = 'Raw';&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;%mend Export;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%export(client 1,client 1);&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2017 15:36:55 GMT</pubDate>
    <dc:creator>troopon</dc:creator>
    <dc:date>2017-05-04T15:36:55Z</dc:date>
    <item>
      <title>Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356009#M83420</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an export step&amp;nbsp;at the end of my code which exports to a excel document on a specific sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Within that excel doc there is a second sheet which links to this data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I initially run (and on most subsequent runs) it all works fine however sometimes when I run I get an error message saying "Error: String is duplicated" plus some symbols in brackets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I get this error message it seems to still export data but also corrupts the excel file. I can go into the excel file but column names have moved, formats changed etc which shouldn't happen.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know what this error message means and how to fix the issue. Odd how it only happens sometimes (though seems to happen more often if I run the full script rather than bit by bit). Code is below. Currently I am only testing it for one client but eventually this will be rolled out to run across multiple clients. I use SAS Studio but don't think this is important for this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro Export (i,j);&lt;BR /&gt;data &amp;amp;j._output;&lt;BR /&gt; set summary ; &lt;BR /&gt; where Client_name = "&amp;amp;i.";&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC EXPORT DATA= WORK.&amp;amp;j._output&lt;BR /&gt; OUTFILE= "\\&amp;lt;file location&amp;gt;\&amp;amp;i..xlsx" &lt;BR /&gt; DBMS=xlsx&lt;BR /&gt; REPLACE;&lt;BR /&gt; SHEET = 'Raw';&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;%mend Export;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%export(client 1,client 1);&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 15:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356009#M83420</guid>
      <dc:creator>troopon</dc:creator>
      <dc:date>2017-05-04T15:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356013#M83422</link>
      <description>&lt;P&gt;This is an Excel error? I haven't seen that error but I noticed that the SHEETNAME option is fixed. Im assuming you're writing to a template?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be possible that there's something in a specific report that's causing the issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rather than create the subset you can place the WHERE in your PROC EXPORT.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 15:49:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356013#M83422</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-04T15:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356016#M83425</link>
      <description>&lt;P&gt;Do you actually have spaces in your i/j variables?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 15:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356016#M83425</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-04T15:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356018#M83427</link>
      <description>&lt;P&gt;Hi Reeza&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No it isn't an excel error. This error appears in the SAS log but for some reason doesn't always occur. It's not an error I have seen (or anyone in my office I have asked has). It's an odd error as it doesn't seem to relate to the statement in anyway. Usually SAS errors have some sort of clue in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This makes me wonder if it's something to do with space because it is a lengthy script although the actual export is only 12 rows for this particular client.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/PROC-EXPORT-lt-lt-ERROR-string-is-duplicated-gt-lt-t-gt-7-lt-t/td-p/271439" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/PROC-EXPORT-lt-lt-ERROR-string-is-duplicated-gt-lt-t-gt-7-lt-t/td-p/271439&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is another post with the same issue however has no resolution&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 15:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356018#M83427</guid>
      <dc:creator>troopon</dc:creator>
      <dc:date>2017-05-04T15:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356019#M83428</link>
      <description>&lt;P&gt;In this case no. i and j are both 1 word. I have called it client 1 up top instead of the actual client. There are also no odd characters within the client name. Just letters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I add additional clients, some will have spaces but this isn't an issue in this instance.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 15:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356019#M83428</guid>
      <dc:creator>troopon</dc:creator>
      <dc:date>2017-05-04T15:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356024#M83431</link>
      <description>&lt;P&gt;I would contact tech support. If needed the developers may be able to say how that error is generated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 16:12:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/356024#M83431</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-04T16:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/440527#M110051</link>
      <description>&lt;P&gt;I realize this question is almost a year old but I've been having this issue for a couple weeks and finally found something that worked for me. I have an xlsx template saved on the server with a hidden sheet simply called "Data" and then a few other formatted sheets in the template with pivots based off the Data tab. I was continually receiving the string was duplicated error when running this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc export&lt;BR /&gt;data=work.Master&lt;BR /&gt;outfile="&amp;amp;xFile."&lt;BR /&gt;dbms=xlsx label replace;&lt;BR /&gt;sheet="Data";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What finally made the difference was when I deleted all rows except the header from the Data tab on my template. Everything is working as intended now. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Not sure this would be the solution for every case, but it at least solved it for me.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 15:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/440527#M110051</guid>
      <dc:creator>titus</dc:creator>
      <dc:date>2018-02-27T15:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/440603#M110098</link>
      <description>We had a similar kind of issue, we use template to create XML files which we open in excel. Some times due to some reason they produce some dummy character at the and, which will cause the XML not opening in Excel. But we can never recreate the issue with same data.</description>
      <pubDate>Tue, 27 Feb 2018 17:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/440603#M110098</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2018-02-27T17:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/463887#M118250</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was having the same issue and simply&amp;nbsp;switched to double quotes on the sheet name.&amp;nbsp; I noticed&amp;nbsp;also in this example.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 21:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/463887#M118250</guid>
      <dc:creator>chazbash</dc:creator>
      <dc:date>2018-05-21T21:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export - Error: String is duplicated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/545191#M150790</link>
      <description>&lt;P&gt;Check there is fix available on SAS Site for this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/62/655.html" target="_blank"&gt;http://support.sas.com/kb/62/655.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 11:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-String-is-duplicated/m-p/545191#M150790</guid>
      <dc:creator>avinashginjupal</dc:creator>
      <dc:date>2019-03-22T11:52:45Z</dc:date>
    </item>
  </channel>
</rss>

