<?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 Question about the ampersand in a macro in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-about-the-ampersand-in-a-macro/m-p/2812#M1231</link>
    <description>It's been awhile since I used macros, but I recall there was a way to alter a variable or dataset name.&lt;BR /&gt;
&lt;BR /&gt;
For example, I am using the following statement:&lt;BR /&gt;
&lt;BR /&gt;
%macro loc(position);&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
proc print data=&amp;amp;position out=&lt;B&gt;&amp;amp;position_t&lt;/B&gt;;&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
%mend loc;&lt;BR /&gt;
%position(xyz)&lt;BR /&gt;
&lt;BR /&gt;
I want dataset xyz to be read in, and I want to output the dataset xyz_t. I feel like maybe I have to put quotes around it or something, but don't recall exactly. Does anyone know what is the proper syntax to name the dataset xyz_t?</description>
    <pubDate>Mon, 16 Apr 2007 13:46:45 GMT</pubDate>
    <dc:creator>npa</dc:creator>
    <dc:date>2007-04-16T13:46:45Z</dc:date>
    <item>
      <title>Question about the ampersand in a macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-about-the-ampersand-in-a-macro/m-p/2812#M1231</link>
      <description>It's been awhile since I used macros, but I recall there was a way to alter a variable or dataset name.&lt;BR /&gt;
&lt;BR /&gt;
For example, I am using the following statement:&lt;BR /&gt;
&lt;BR /&gt;
%macro loc(position);&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
proc print data=&amp;amp;position out=&lt;B&gt;&amp;amp;position_t&lt;/B&gt;;&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
%mend loc;&lt;BR /&gt;
%position(xyz)&lt;BR /&gt;
&lt;BR /&gt;
I want dataset xyz to be read in, and I want to output the dataset xyz_t. I feel like maybe I have to put quotes around it or something, but don't recall exactly. Does anyone know what is the proper syntax to name the dataset xyz_t?</description>
      <pubDate>Mon, 16 Apr 2007 13:46:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-about-the-ampersand-in-a-macro/m-p/2812#M1231</guid>
      <dc:creator>npa</dc:creator>
      <dc:date>2007-04-16T13:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Question about the ampersand in a macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-about-the-ampersand-in-a-macro/m-p/2813#M1232</link>
      <description>Hi! Remember that you need to provide a way for the macro processor to tell when the end of the macro variable name has been reached. so if you had this:&lt;BR /&gt;
&lt;BR /&gt;
&amp;amp;lib..&amp;amp;dsn&lt;BR /&gt;
 &lt;BR /&gt;
then the first . will signal the end of &amp;amp;lib and the second . will be inserted after &amp;amp;lib resolves. so if &amp;amp;lib is SASHELP and &amp;amp;dsn is CLASS then&lt;BR /&gt;
&lt;BR /&gt;
&amp;amp;lib..&amp;amp;dsn  would resolve to SASHELP.&amp;amp;dsn which would resolve to SASHELP.CLASS&lt;BR /&gt;
&lt;BR /&gt;
So in your case, you should do:&lt;BR /&gt;
&lt;BR /&gt;
&amp;amp;position._t&lt;BR /&gt;
&lt;BR /&gt;
also, you were probably typing fast, but I thought, just in case, I'd mention that since your macro statement has &lt;BR /&gt;
%macro LOC(position), then the correct invocation would be:&lt;BR /&gt;
&lt;BR /&gt;
%loc(xyz)&lt;BR /&gt;
&lt;BR /&gt;
good luck,&lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 16 Apr 2007 15:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-about-the-ampersand-in-a-macro/m-p/2813#M1232</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-04-16T15:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Question about the ampersand in a macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-about-the-ampersand-in-a-macro/m-p/2814#M1233</link>
      <description>That's it. Thanks for the help. You're right. I was typing fast.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Mon, 23 Apr 2007 18:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-about-the-ampersand-in-a-macro/m-p/2814#M1233</guid>
      <dc:creator>npa</dc:creator>
      <dc:date>2007-04-23T18:31:00Z</dc:date>
    </item>
  </channel>
</rss>

