<?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: Macro to delete Index in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552074#M153466</link>
    <description>&lt;P&gt;The macro code has been damaged because somebody did not use the proper subwindow ("little running man" or {i} button) for posting code.&lt;/P&gt;
&lt;P&gt;This is the culprit:&lt;/P&gt;
&lt;PRE&gt;%str(Smiley Wink;&lt;/PRE&gt;
&lt;P&gt;The missing closing bracket causes everything after it to be considered part of the macro function parameter, which in the end leads to this message:&lt;/P&gt;
&lt;PRE&gt;NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's why we always keep pestering people to post code correctly (NOT in the main posting window).&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2019 12:08:55 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-04-18T12:08:55Z</dc:date>
    <item>
      <title>Macro to delete Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552038#M153452</link>
      <description>&lt;P&gt;I was trying to delete an index from a table if that exist and if it does not exist then create one. This is the final objective. I found a macro on this community&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let final_file=testfile;

%macro flg_exist(final_File);
%let dsid=%sysfunc(open(&amp;amp;final_File.));
%let ndx_flag=%sysfunc(attrn(&amp;amp;dsid,isindex));
%put Index exists flag= &amp;amp;ndx_flag;

%let rc=%sysfunc(close( &amp;amp;dsid ));
%put Dataset closed return code= &amp;amp;rc;

%if &amp;amp;ndx_flag=1 %then %let ndx_delete=index delete zip5 %str(Smiley Wink;
%else %if &amp;amp;ndx_flag=0 %then %let ndx_delete=;
%put Index delete statement =&amp;amp;ndx_delete;
%mend;

%flg_exist(&amp;amp;final_File.);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however I am getting following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ODS _ALL_ CLOSE;
9          OPTIONS DEV=ACTIVEX;
&lt;FONT color="#008000"&gt;NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.&lt;/FONT&gt;
1          ;*';*";*/;quit;run;
&lt;FONT color="#FF0000"&gt;                ______________
                49
N&lt;/FONT&gt;OTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space 
             between a quoted string and the succeeding identifier is recommended.

10         GOPTIONS XPIXELS=0 YPIXELS=0;
11         FILENAME EGSR TEMP;
12         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
13             STYLE=FestivalPrinter
14             STYLESHEET=(URL="file:///C:/Program%20Files/SASHome2/SASEnterpriseGuide/7.1/Styles/FestivalPrinter.css")
14             STYLESHEET=(URL="file:///C:/Program%20Files/SASHome2/SASEnterpriseGuide/7.1/Styles/FestivalPrinter.css"

&lt;FONT color="#FF0000"&gt;___________________________________________________________________________________________ &lt;/FONT&gt;   &lt;/PRE&gt;&lt;P&gt;My only purpose is to delete the index if it is there, then create an index. So other solution will also work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 09:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552038#M153452</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2019-04-18T09:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to delete Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552040#M153454</link>
      <description>&lt;P&gt;This is most likely not caused by the code you have listed but is caused somewhere else in your program - you have an opening quotation mark somewhere without a corresponding closing one, the SAS compiler then becomes confused thinking your next opening quote is the closing quote of the previous one and so on.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 09:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552040#M153454</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2019-04-18T09:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to delete Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552045#M153456</link>
      <description>&lt;P&gt;This is the only code used for this purpose.So if there is an error that is in available in my shown code only. Let me know where do you see this error. Finalfile macro is just a dateset name.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 10:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552045#M153456</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2019-04-18T10:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to delete Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552063#M153462</link>
      <description>&lt;P&gt;Perhaps it is just my browser, but I can see the following in your code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%str(Smiley Wink;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which I guess is caused by an attempt to supply a semicolon in the &lt;FONT face="courier new,courier"&gt;%str()&lt;/FONT&gt; function.&lt;/P&gt;&lt;P&gt;If that is also in your SAS code then you could try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%str( ; );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 11:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552063#M153462</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2019-04-18T11:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to delete Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552074#M153466</link>
      <description>&lt;P&gt;The macro code has been damaged because somebody did not use the proper subwindow ("little running man" or {i} button) for posting code.&lt;/P&gt;
&lt;P&gt;This is the culprit:&lt;/P&gt;
&lt;PRE&gt;%str(Smiley Wink;&lt;/PRE&gt;
&lt;P&gt;The missing closing bracket causes everything after it to be considered part of the macro function parameter, which in the end leads to this message:&lt;/P&gt;
&lt;PRE&gt;NOTE: The quoted string currently being processed has become more than 262 bytes long.  You might have unbalanced quotation marks.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's why we always keep pestering people to post code correctly (NOT in the main posting window).&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 12:08:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552074#M153466</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-18T12:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to delete Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552099#M153475</link>
      <description>&lt;P&gt;I am stupid. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 13:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552099#M153475</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2019-04-18T13:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to delete Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552100#M153476</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 13:23:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552100#M153476</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2019-04-18T13:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to delete Index</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552138#M153488</link>
      <description>&lt;P&gt;We're all learning. Using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mlogic symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;before you invoked the macro might have assisted by displaying extra information in the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 14:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-delete-Index/m-p/552138#M153488</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2019-04-18T14:35:09Z</dc:date>
    </item>
  </channel>
</rss>

