<?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: How to Mask a Period in Executing a Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181116#M34568</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a dummy dataset by using the macro variable with the values provided and it has created a dataset without any problem. Could you please check the below code and let me know if this is not the way you want to use it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let cutoff = 90 95 96 96.5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;cutoff;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array mac(4) (&amp;amp;cutoff);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i = 1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; new=mac(i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Dec 2013 01:10:03 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2013-12-24T01:10:03Z</dc:date>
    <item>
      <title>How to Mask a Period in Executing a Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181115#M34567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My macro is looping through an array of numbers.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;%let cutoff = 90 95 96 96.5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro works just fine for the integers, but not for the numbers with decimal marks.&amp;nbsp; For 96.5, the macro thinks that it is 2 separate numbers - 96 and 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="font-size: small; line-height: 1.5em; color: #444444; font-family: arial, sans-serif; background-color: #ffffff;"&gt;%STR &lt;/SPAN&gt;&lt;SPAN style="font-size: small; line-height: 1.5em; color: #444444; font-family: arial, sans-serif; background-color: #ffffff;"&gt;and %NRSTR functions do not mask periods.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make the macro to recognize 96.5 properly?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that a masking macro function is needed, but I can't fine one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Dec 2013 00:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181115#M34567</guid>
      <dc:creator>EricCai</dc:creator>
      <dc:date>2013-12-24T00:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to Mask a Period in Executing a Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181116#M34568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a dummy dataset by using the macro variable with the values provided and it has created a dataset without any problem. Could you please check the below code and let me know if this is not the way you want to use it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let cutoff = 90 95 96 96.5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;cutoff;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array mac(4) (&amp;amp;cutoff);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i = 1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; new=mac(i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Dec 2013 01:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181116#M34568</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-12-24T01:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Mask a Period in Executing a Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181117#M34569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to provide more about how you are using the values.&lt;/P&gt;&lt;P&gt;Perhaps you are using the %SCAN() function?&amp;nbsp; The default delimiters for %SCAN() do include a period, but you can specify the delimiters you want to use.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%let cutoff = 90 95 96 96.5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%do i=1 %to %countw(&amp;amp;cutoff,%str( ));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let value=%scan(&amp;amp;cutoff,&amp;amp;i,%str( ));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Dec 2013 03:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181117#M34569</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-12-24T03:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Mask a Period in Executing a Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181118#M34570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh...yes, thank you, Tom.&amp;nbsp; I did not specify the delimiter when I used %SCAN().&amp;nbsp; Once I corrected that with %STR( ), the macro worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And thank you, Jagadishkatam, for providing your sample code!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Dec 2013 04:32:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Mask-a-Period-in-Executing-a-Macro/m-p/181118#M34570</guid>
      <dc:creator>EricCai</dc:creator>
      <dc:date>2013-12-24T04:32:55Z</dc:date>
    </item>
  </channel>
</rss>

