<?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 programming help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833529#M329512</link>
    <description>&lt;P&gt;Is it wrong to write like this in SAS code that you want t to be a string in macro?&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;%macro hentami(t,data,aar); &lt;BR /&gt;&lt;BR /&gt;data kuhr&amp;amp;aar.; &lt;BR /&gt;set kuhr.kuhr_&amp;amp;aar.; &lt;BR /&gt;rename pasientlopenummer =lopenummer; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data "&amp;amp;t"kuhr&amp;amp;aar.; &lt;BR /&gt;merge &amp;amp;data (in=a) kuhr&amp;amp;aar.; &lt;BR /&gt;if a by lopenummer; &lt;BR /&gt;&lt;BR /&gt;uke =round((differansedager -inn_refdager0)7,1); &lt;BR /&gt;tjeneste=sum(fastlege,legevakt,spesialist,psykolog); &lt;BR /&gt;if uke ge 0 and uke le 52 then output; &lt;BR /&gt;run; &lt;BR /&gt;%mend; &lt;BR /&gt;&lt;BR /&gt;%hentami_kuhr(ami,ami_index,2008); &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;I got an error message when I write "&amp;amp;t"kuhr&amp;amp;aar. in macro %hentami_kuhr(t,data,aar) there t is a text, data is a dataset and aar is year (like 2008). How can I rewrite this macro code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 08:15:24 GMT</pubDate>
    <dc:creator>user40</dc:creator>
    <dc:date>2022-09-15T08:15:24Z</dc:date>
    <item>
      <title>programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833529#M329512</link>
      <description>&lt;P&gt;Is it wrong to write like this in SAS code that you want t to be a string in macro?&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;%macro hentami(t,data,aar); &lt;BR /&gt;&lt;BR /&gt;data kuhr&amp;amp;aar.; &lt;BR /&gt;set kuhr.kuhr_&amp;amp;aar.; &lt;BR /&gt;rename pasientlopenummer =lopenummer; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data "&amp;amp;t"kuhr&amp;amp;aar.; &lt;BR /&gt;merge &amp;amp;data (in=a) kuhr&amp;amp;aar.; &lt;BR /&gt;if a by lopenummer; &lt;BR /&gt;&lt;BR /&gt;uke =round((differansedager -inn_refdager0)7,1); &lt;BR /&gt;tjeneste=sum(fastlege,legevakt,spesialist,psykolog); &lt;BR /&gt;if uke ge 0 and uke le 52 then output; &lt;BR /&gt;run; &lt;BR /&gt;%mend; &lt;BR /&gt;&lt;BR /&gt;%hentami_kuhr(ami,ami_index,2008); &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;I got an error message when I write "&amp;amp;t"kuhr&amp;amp;aar. in macro %hentami_kuhr(t,data,aar) there t is a text, data is a dataset and aar is year (like 2008). How can I rewrite this macro code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 08:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833529#M329512</guid>
      <dc:creator>user40</dc:creator>
      <dc:date>2022-09-15T08:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833530#M329513</link>
      <description>&lt;P&gt;Try modifying it as follows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data &amp;amp;t.kuhr&amp;amp;aar.;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 08:25:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833530#M329513</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-09-15T08:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833532#M329515</link>
      <description>Thanks. It works. Then we cannot have special character in some macro like this &amp;amp;t._kuhr&amp;amp;aar.; ?</description>
      <pubDate>Thu, 15 Sep 2022 08:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833532#M329515</guid>
      <dc:creator>user40</dc:creator>
      <dc:date>2022-09-15T08:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833534#M329516</link>
      <description>&lt;P&gt;use %str or %nrstr for special charactor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro Mtest(val);
  data sample;
    a="&amp;amp;val";
  run;
  proc print;run;
%Mend;

%Mtest(xxx,yyy)/* error */

%Mtest(%str(xxx,yyy))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Sep 2022 08:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/833534#M329516</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-09-15T08:58:11Z</dc:date>
    </item>
  </channel>
</rss>

