<?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: MacoSAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321178#M70856</link>
    <description>&lt;P&gt;The reason the I resolves to 8 is that it is set within the macro trimname to a value of 8 with %let statement. As per the image, the macro is supposed to loop if I ne 0, since 8 ne 0 the loop executes and the text is compressed to keep only the alphabets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure of the purpose as I see the macro trimname is used to put&amp;nbsp; the text in the title.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Dec 2016 13:19:11 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2016-12-26T13:19:11Z</dc:date>
    <item>
      <title>Macro SAS - %CMPRES function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321157#M70845</link>
      <description>&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6492i7BA0B7112497AF1E/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="i resolve to 8.png" title="i resolve to 8.png" /&gt;&lt;/P&gt;
&lt;P&gt;I resolve to 8.what &amp;nbsp;does it signifies?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(data sets frrom SAS Macro Programming Made Easy)&lt;/P&gt;
&lt;P&gt;options mprint mlogic symbolgen;&lt;BR /&gt;%macro trimname(namevalue);&lt;BR /&gt;%cmpres(%qupcase(%sysfunc(&lt;BR /&gt;compress(%superq(namevalue),%str(, ),kA))))&lt;BR /&gt;%mend trimname;&lt;/P&gt;
&lt;P&gt;proc tabulate data=work.ytdsales&lt;BR /&gt;(where=(upcase(author)=&lt;BR /&gt;"%trimname(%str(wright, LINDA, Lisa))"))&lt;BR /&gt;;&lt;BR /&gt;title "Title list for %trimname(%str(wright, linda, lisa))";&lt;BR /&gt;class booktitle datesold bookfmt;&lt;BR /&gt;tables booktitle=' ',&lt;BR /&gt;datesold="Quarter Sold" all='**Total Books Sold',&lt;BR /&gt;all="Books Sold"*(bookfmt all='Total')*n=' '*f=3. / misstext='0';&lt;BR /&gt;format datesold qtr.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 20:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321157#M70845</guid>
      <dc:creator>Tap222</dc:creator>
      <dc:date>2016-12-26T20:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: MacoSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321161#M70848</link>
      <description>&lt;P&gt;The question is unclear.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 11:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321161#M70848</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-26T11:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: MacoSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321175#M70855</link>
      <description>&lt;P&gt;Actually in the figure there is "I" which shows it resolve to 8.I am not able to understand why it resolves to 8.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 12:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321175#M70855</guid>
      <dc:creator>Tap222</dc:creator>
      <dc:date>2016-12-26T12:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: MacoSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321178#M70856</link>
      <description>&lt;P&gt;The reason the I resolves to 8 is that it is set within the macro trimname to a value of 8 with %let statement. As per the image, the macro is supposed to loop if I ne 0, since 8 ne 0 the loop executes and the text is compressed to keep only the alphabets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure of the purpose as I see the macro trimname is used to put&amp;nbsp; the text in the title.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 13:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321178#M70856</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-12-26T13:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: MacoSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321207#M70873</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117945"&gt;@Tap222&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Actually in the figure there is "I" which shows it resolve to 8.I am not able to understand why it resolves to 8.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there's no I in the code or %let, then it likely comes from the other macro CMPRES.&lt;/P&gt;
&lt;P&gt;I do wonder why you're using both Compress function and compress macro function though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Extracting that code provides:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %macro cmpres(text);
 %*********************************************************************;
 %*                                                                   *;
 %*  MACRO: CMPRES                                                    *;
 %*                                                                   *;
 %*  USAGE: 1) %cmpres(argument)                                      *;
 %*                                                                   *;
 %*  DESCRIPTION:                                                     *;
 %*    This macro returns the argument passed to it in an unquoted    *;
 %*    form with multiple blanks compressed to single blanks and also *;
 %*    with leading and trailing blanks removed.                      *;
 %*                                                                   *;
 %*    Eg. %let macvar=%cmpres(&amp;amp;argtext)                              *;
 %*                                                                   *;
 %*  NOTES:                                                           *;
 %*    The %LEFT and %TRIM macros in the autocall library are used    *;
 %*    in this macro.                                                 *;
 %*                                                                   *;
 %*********************************************************************;
 %local i;
 %let i=%index(&amp;amp;text,%str(  ));
 %do %while(&amp;amp;i ne 0);
   %let text=%qsubstr(&amp;amp;text,1,&amp;amp;i)%qleft(%qsubstr(&amp;amp;text,&amp;amp;i+1));
   %let i=%index(&amp;amp;text,%str(  ));
 %end;
 %left(%qtrim(&amp;amp;text))
 %mend;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 20:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321207#M70873</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-26T20:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: MacoSAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321208#M70874</link>
      <description>To find the macro definition, note the 5th line of your log, which provides the program from %cmpres auto call macro.</description>
      <pubDate>Mon, 26 Dec 2016 20:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-SAS-CMPRES-function/m-p/321208#M70874</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-26T20:57:36Z</dc:date>
    </item>
  </channel>
</rss>

