<?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 achieve variable-name modification in a macro? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84472#M18192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also considering your other thread around this macro (&lt;A _jive_internal="true" href="https://communities.sas.com/message/123512#123512"&gt;https://communities.sas.com/message/123512#123512&lt;/A&gt;) you probabely should give us the full code and also tell us what you have, what you want and what problem you really want to solve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my experience a lot of people at a certain stage in their "SAS skills development" tend to overuse macro coding and to forget about simple SAS datastep aproaches. Consider that you should try to write code which you still can easily understand in 6 months time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Apr 2012 12:06:00 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2012-04-16T12:06:00Z</dc:date>
    <item>
      <title>how to achieve variable-name modification in a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84471#M18191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I have&lt;/P&gt;&lt;P&gt;%inseg10(wu1.custbase2m,work.T8_1a,'N',SA,SAP,'IN1');&lt;/P&gt;&lt;P&gt;%macro inseg10(dsin,dsout,ntb,product1,product2,custclass);&lt;/P&gt;&lt;P&gt;in fact product2=product1||'P';*variable name in a data set ,for eg&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SA,SAP;&lt;/P&gt;&lt;P&gt;I tried debug in macro inseg10:&lt;/P&gt;&lt;P&gt;%put &amp;amp;product1||'P';&lt;/P&gt;&lt;P&gt;%put &amp;amp;product1||P;&lt;/P&gt;&lt;P&gt;neither output is what I wanted as below&lt;/P&gt;&lt;P&gt;SAP;&lt;/P&gt;&lt;P&gt;How can I use statement in macro using &amp;amp; product1 to constitute product2?&lt;/P&gt;&lt;P&gt;THANKS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 07:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84471#M18191</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-04-16T07:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to achieve variable-name modification in a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84472#M18192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also considering your other thread around this macro (&lt;A _jive_internal="true" href="https://communities.sas.com/message/123512#123512"&gt;https://communities.sas.com/message/123512#123512&lt;/A&gt;) you probabely should give us the full code and also tell us what you have, what you want and what problem you really want to solve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my experience a lot of people at a certain stage in their "SAS skills development" tend to overuse macro coding and to forget about simple SAS datastep aproaches. Consider that you should try to write code which you still can easily understand in 6 months time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 12:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84472#M18192</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-04-16T12:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to achieve variable-name modification in a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84473#M18193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To SAS macro code everything is a string. So if you have a macro variable called PRODUCT1 with the value SA and you want to use it to refer to variables SA and SAP in the actual SAS code that the macro will generate you do not need any concatenation characters.&amp;nbsp; What you need is to use a period to tell SAS not to look for a macro variable named PRODUCT1P.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc means ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; var &amp;amp;product1 &amp;amp;product1.p ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 15:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84473#M18193</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-04-16T15:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to achieve variable-name modification in a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84474#M18194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,Thanks for your patient explantion. It works. Dawn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 01:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84474#M18194</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-04-17T01:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to achieve variable-name modification in a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84475#M18195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;patrick,&lt;/P&gt;&lt;P&gt;You are absolutely right. I am on my first time writing macro while with only 4 months experience of SAS.&lt;/P&gt;&lt;P&gt;thanks for your guiding. I will go on.&lt;/P&gt;&lt;P&gt;dawn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 01:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-achieve-variable-name-modification-in-a-macro/m-p/84475#M18195</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-04-17T01:31:29Z</dc:date>
    </item>
  </channel>
</rss>

