<?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: Creating macros for titles in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128986#M26340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes its possible, first off though macro variables only resolve when in double quotes. And you may need to quote your macro variables in your where condition to have the code be valid SAS code.&lt;/P&gt;&lt;P&gt;Again, you've provided parameters at the top but haven't called it with any...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jul 2013 16:43:37 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-07-08T16:43:37Z</dc:date>
    <item>
      <title>Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128980#M26334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm running a report on building stats. I'm using the by statement in the report so that I get separate tables for each building. I want to add I have the variables building_id and building_name to the title of each report. I am not sure how to create a macro for 2 variables. Can I modify this code to include the building_name as shown below? Also, instead of calling the individual buildings with %do_id at the end, can I build a smarter macro that looks for each unique ID number and runs the report?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro do_id(building_id);&lt;/P&gt;&lt;P&gt;%macro do_name(building_name);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title1 "Annual Report for &amp;amp;id and &amp;amp;name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc report data=buildings;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by buiding_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; define .....&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend do_id;&lt;/P&gt;&lt;P&gt;%mend do_name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do_id (A94); &lt;/P&gt;&lt;P&gt;%do_id (A02) &lt;/P&gt;&lt;P&gt;%do_id (A503);&lt;/P&gt;&lt;P&gt;%do_id (A06);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 15:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128980#M26334</guid>
      <dc:creator>sarahsasuser</dc:creator>
      <dc:date>2013-07-08T15:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128981#M26335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what the question is.&lt;/P&gt;&lt;P&gt;If you want the TITLE to reflect the value of the BY variable then use #BYVAL() in the TITLE statement.&amp;nbsp; See the documentation on the TITLE statement.&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000220968.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000220968.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;title1 "Annual Report for #byval(building_id) and #byval(building_name)"&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;options nobyline;&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;proc ...&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; by building_id building_name;&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;/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;P&gt;&lt;/P&gt;&lt;P&gt;If you want to pass more than one parameter into a macro then just define it with more than one parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro do_id_name(id,name);&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;title1 "Annual Report for &amp;amp;id and &amp;amp;name";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt; where building_id = &amp;amp;id and building_name = "&amp;amp;name" ;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;%mend do_id_name;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 15:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128981#M26335</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-07-08T15:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128982#M26336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions. Since I have a couple of different tables I want to create for each building I think using a macro with more than one parameter is the best solution. However, I'm new to macros and am having trouble with the next step. I wrote this marco: &lt;SPAN style="font-family: inherit; font-style: inherit; font-size: 10pt; line-height: 1.5em;"&gt;%macro do_id_name(id,name). When I call the macro with &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #ffffff;"&gt;%do_id_name&lt;/SPAN&gt;; I get this error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-style: inherit; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference ID not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NAME not resolved.&lt;/P&gt;&lt;P&gt;ERROR: Syntax error while parsing WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a numeric constant, a datetime constant, a missing value, INPUT, PUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have:&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;%macro do_id_name(id,name);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;....proc report&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; &lt;SPAN style="font-style: inherit;"&gt;title1 "Annual Report for &amp;amp;id and &amp;amp;name";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;...&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;where building_id = &amp;amp;id and building_name = "&amp;amp;name" ;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;....&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;proc report&lt;/P&gt;&lt;P style="font-family: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-style: inherit;"&gt;title1 "Annual Report for &amp;amp;id and &amp;amp;name";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: inherit; font-style: inherit;"&gt;...&lt;/P&gt;&lt;P style="font-family: inherit; font-style: inherit;"&gt;where building_id = &amp;amp;id and building_name = &amp;amp;name ;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;....&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;%mend do_id_name;&lt;/P&gt;&lt;P class="jive-thread-reply-btn" style="margin: 26px 0 -10px; font-size: 0.9em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%do_id_name;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 16:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128982#M26336</guid>
      <dc:creator>sarahsasuser</dc:creator>
      <dc:date>2013-07-08T16:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128983#M26337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need a macro if you're generating all at once is what Tom is implying. The BY variables become macro variables of a sort and you can reference them, without having to explicitly create them.&lt;/P&gt;&lt;P&gt;See how Tom used #byval(building_id) and #byval(#name) in the title above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want a macro route then its best to post your code and log to help with debugging. for starters, your last line that calls the macro doesn't include the input parameters or the underscores in the macro name. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 16:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128983#M26337</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-08T16:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128984#M26338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to create a real macro with real code replacing the ... &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; &lt;/P&gt;&lt;P&gt;This message is an indication that your macro is not defined. Check for errors from SAS when it actually compiled the macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;WARNING: Apparent symbolic reference ID not resolved.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;WARNING: Apparent symbolic reference NAME not resolved.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;You also might have unbalanced quotes or () that are confusing it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 16:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128984#M26338</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-07-08T16:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128985#M26339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza and Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want to use the #byval because I have 3 report tables I need to make for each building id. If I do a byval, it will run table #1 for each building, and then table 2 for each building and so on. I want instead to run for building 1 tables #1 - table #3, then building 2 tables 1-3, etc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code. Do I need to call each building id/name combo in the %do_id_name; statement? For instance %do_id_name (1, 1222 smith st)? I'd like for the macro to run through the dataset and run the report for each unique building id/name combo, instead of me having to tell it to. Is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro do_id_name(building_id,building_name);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc report data=have nowd split='/';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; title '&amp;amp;id and&amp;amp;name';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; where b&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;uilding_id = &amp;amp;id and building_name = &amp;amp;name ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; columns Type Subtype Region Count Expected count_ontime late pct_within pct_not_within;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define Type/display&amp;nbsp; " Type";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define subtype /display&amp;nbsp; "subtype";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define&amp;nbsp; Region/display&amp;nbsp; "Region";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define Count/ display "Count";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define Expected/&amp;nbsp; display 'Expected';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define count_ontime/display '# Ontime';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define late/display&amp;nbsp; '# late';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define Pct_within/display&amp;nbsp; '% ontime' format=PERCENT7.0;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; define Pct_not_within/display&amp;nbsp; '% late' format=PERCENT7.0;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;%mend do_id_name;&lt;/P&gt;&lt;P&gt;%do_id_name;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 16:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128985#M26339</guid>
      <dc:creator>sarahsasuser</dc:creator>
      <dc:date>2013-07-08T16:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128986#M26340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes its possible, first off though macro variables only resolve when in double quotes. And you may need to quote your macro variables in your where condition to have the code be valid SAS code.&lt;/P&gt;&lt;P&gt;Again, you've provided parameters at the top but haven't called it with any...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 16:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128986#M26340</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-08T16:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128987#M26341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot that double quotes were needed. I've substituted double quotes for singles in the proc report statement and around "&amp;amp;name" as this is a character field. I've added the parameters when I call the macro: &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%do_id_name (&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;building_id,building_name)&lt;/SPAN&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I'm still getting this error:&lt;/P&gt;&lt;P&gt;2500&amp;nbsp; %mend do_id_name;&lt;/P&gt;&lt;P&gt;2501&amp;nbsp; %do_id_name(building_id,building_name);&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference ID not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NAME not resolved.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the invoked macro "DO_ID_NAME".&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc report data=les.all_cover nowd split="/";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where building_id = &amp;amp;id and building_name =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;76&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp; ! "&amp;amp;name" ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns ....&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference ID not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NAME not resolved.&lt;/P&gt;&lt;P&gt;ERROR: Syntax error while parsing WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a numeric constant, a datetime constant, a missing value, INPUT, PUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 16:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128987#M26341</guid>
      <dc:creator>sarahsasuser</dc:creator>
      <dc:date>2013-07-08T16:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128988#M26342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure the parameter names you define in the %MACRO statement match the macro variable references in the code.&lt;/P&gt;&lt;P&gt;Make sure to use double quotes so that macro references are resolved.&lt;/P&gt;&lt;P&gt;Make sure to quote the values of character variables in the generated SAS code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro do_id_name(&lt;STRONG&gt;id,name&lt;/STRONG&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc report data=have nowd split='/';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; title "&amp;amp;id and &amp;amp;name";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; where b&lt;SPAN style="font-style: inherit;"&gt;uilding_id = &lt;STRONG&gt;&amp;amp;id&lt;/STRONG&gt; and building_name = &lt;STRONG&gt;"&amp;amp;name"&lt;/STRONG&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; columns Type Subtype Region Count Expected count_ontime late pct_within pct_not_within;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define Type/display&amp;nbsp; " Type";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define subtype /display&amp;nbsp; "subtype";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define&amp;nbsp; Region/display&amp;nbsp; "Region";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define Count/ display "Count";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define Expected/&amp;nbsp; display 'Expected';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define count_ontime/display '# Ontime';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define late/display&amp;nbsp; '# late';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define Pct_within/display&amp;nbsp; '% ontime' format=PERCENT7.0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; define Pct_not_within/display&amp;nbsp; '% late' format=PERCENT7.0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend do_id_name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%do_id_name(&lt;SPAN style="background-color: #ffffff;"&gt;1, 1222 smith st);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;To generate a call for each value in the data there are a number of methods.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;With a small list of values you might just generate the calls into a macro variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;proc sql noprint ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;&amp;nbsp; select distinct cats('%do_id_name(', building_id , ',' , building_name ,')')&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :runlist separated by ';' &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt; from have &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;&amp;amp;runlist ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 17:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128988#M26342</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-07-08T17:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128989#M26343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The last example in the link below is close to what you're looking for, there are also lots of other examples on here, but get your base macro working first &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/seminars/sas_macros_introduction/" title="http://www.ats.ucla.edu/stat/sas/seminars/sas_macros_introduction/"&gt;Statistical Computing Seminar: Introduction to SAS Macro Language&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 17:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128989#M26343</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-08T17:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128990#M26344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, the documentation is helpful. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 17:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128990#M26344</guid>
      <dc:creator>sarahsasuser</dc:creator>
      <dc:date>2013-07-08T17:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating macros for titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128991#M26345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom! This was very helpful. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 17:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-macros-for-titles/m-p/128991#M26345</guid>
      <dc:creator>sarahsasuser</dc:creator>
      <dc:date>2013-07-08T17:25:23Z</dc:date>
    </item>
  </channel>
</rss>

