<?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 Create Macros Conditionally in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206588#M38384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;I am trying to create multiple macro variables based on various conditions. Below is my code. I am not sure whether this is the most efficient way.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*to get total number of obs and max value of count variable where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count(*),max(count)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;into : count1, count2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;lt;5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*to get total number of obs and max value of count variable where count&amp;gt;=5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count(*),max(count)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;into : count1, count2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;gt;=5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*count of name where count&amp;gt;=5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count (distinct name) into:cnt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;gt;=5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*count of name where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count (distinct name) into:cnt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*get names into macro where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select distinct name into : name1-:name&amp;amp;sysmaxlong&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;repeat the above step for count&amp;gt;=5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;Is there a shorter/more concise way for the above. Will appreciate inputs on a more efficient approach.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 12pt; font-style: inherit; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;Thanks!all&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2015 07:06:49 GMT</pubDate>
    <dc:creator>sasmaverick</dc:creator>
    <dc:date>2015-03-20T07:06:49Z</dc:date>
    <item>
      <title>Create Macros Conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206588#M38384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;I am trying to create multiple macro variables based on various conditions. Below is my code. I am not sure whether this is the most efficient way.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*to get total number of obs and max value of count variable where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count(*),max(count)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;into : count1, count2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;lt;5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*to get total number of obs and max value of count variable where count&amp;gt;=5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count(*),max(count)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;into : count1, count2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;gt;=5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*count of name where count&amp;gt;=5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count (distinct name) into:cnt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;gt;=5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*count of name where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count (distinct name) into:cnt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;*get names into macro where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;proc sql&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select distinct name into : name1-:name&amp;amp;sysmaxlong&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;lt;5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;repeat the above step for count&amp;gt;=5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;Is there a shorter/more concise way for the above. Will appreciate inputs on a more efficient approach.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 12pt; font-style: inherit; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;Thanks!all&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 07:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206588#M38384</guid>
      <dc:creator>sasmaverick</dc:creator>
      <dc:date>2015-03-20T07:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macros Conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206589#M38385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No need for so many proc sql block, only one is enough . and combine these sql statement which are under the same condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;select count(*),max(count),&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;count (distinct name) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;into : count1, :count2, :cnt &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;from dataset1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;where count&amp;gt;=5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;............&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;............&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 08:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206589#M38385</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-20T08:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macros Conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206590#M38386</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;IMO the answer to:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;" I am not sure whether this is the most efficient way."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;would be no.&amp;nbsp; Whenever I need to deal with more than one (or even one if its dates or such like) then I would put parameters into a dataset.&amp;nbsp; It is then simply a matter of merging on the parameter dataset to use them.&amp;nbsp; Avoids all that nasty:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;&amp;amp;&amp;amp;&amp;amp;%str(&amp;amp;&amp;amp;&amp;amp;av_&amp;amp;&amp;amp;i.) nonsense with simple to understand merging.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;Most languages provide some sort of macro facility, but they are used very rarely and only for specific things.&amp;nbsp; The opposite is true in SAS, most of the code seems to be in macros even though with a bit of thought 90% of it can be done in straight code.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 09:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206590#M38386</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-03-20T09:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macros Conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206591#M38387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Adding to your code:&lt;/P&gt;&lt;P&gt;%macro choose(type=);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;select count(*),max(count),count (distinct name)&lt;/P&gt;&lt;P&gt;into : count1&amp;amp;type., :count2&amp;amp;type., :cnt&amp;amp;type.&lt;/P&gt;&lt;P&gt;from dataset1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;type = eq %then %do;&lt;/P&gt;&lt;P&gt;where count = 5&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%if &amp;amp;type = lt %then %do;&lt;/P&gt;&lt;P&gt;where count &amp;lt; 5&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%if &amp;amp;type = gt %then %do;&lt;/P&gt;&lt;P&gt;where count &amp;gt; 5&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%mend choose;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%choose(type=eq);&lt;/P&gt;&lt;P&gt;%choose(type=lt);&lt;/P&gt;&lt;P&gt;%choose(type=gt);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 16:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macros-Conditionally/m-p/206591#M38387</guid>
      <dc:creator>jwillis</dc:creator>
      <dc:date>2015-04-02T16:48:35Z</dc:date>
    </item>
  </channel>
</rss>

