<?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: Macro - Different Data Types in Where Clause in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Different-Data-Types-in-Where-Clause/m-p/175238#M33660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the familynumber column numeric? If so: where familynumber = &amp;amp;&amp;amp;family&amp;amp;i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Oct 2014 19:08:03 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2014-10-07T19:08:03Z</dc:date>
    <item>
      <title>Macro - Different Data Types in Where Clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Different-Data-Types-in-Where-Clause/m-p/175237#M33659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working with a transaction type data set where there are multiple observations for individual children nested within families.&amp;nbsp; Each child has a unique" child_id" and an associated "familynumber." I would like to generate a count of the number of children in each family.&amp;nbsp; I have attempted to use the following code, but I am receiving an error that informs me that there are different data types in the WHERE clause.&amp;nbsp; Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint; &lt;/P&gt;&lt;P&gt; select left(put(count(distinct(familynumber)),15.0)) into :fmcount work.time;&lt;/P&gt;&lt;P&gt; select distinct(familynumber) into :family1 - :family&amp;amp;fmcount from work.time; &lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro family_count; &lt;/P&gt;&lt;P&gt; %do i = 1 %to &amp;amp;fmcount; &lt;/P&gt;&lt;P&gt; proc sql noprint; &lt;/P&gt;&lt;P&gt; select count(distinct(child_id)) from work.time &lt;/P&gt;&lt;P&gt; where familynumber = "&amp;amp;&amp;amp;family&amp;amp;i"; &lt;/P&gt;&lt;P&gt; quit; &lt;/P&gt;&lt;P&gt; %end;&lt;/P&gt;&lt;P&gt;%mend family_count; &lt;/P&gt;&lt;P&gt;%family_count; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 18:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Different-Data-Types-in-Where-Clause/m-p/175237#M33659</guid>
      <dc:creator>PhillipSherlock</dc:creator>
      <dc:date>2014-10-07T18:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro - Different Data Types in Where Clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Different-Data-Types-in-Where-Clause/m-p/175238#M33660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the familynumber column numeric? If so: where familynumber = &amp;amp;&amp;amp;family&amp;amp;i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 19:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Different-Data-Types-in-Where-Clause/m-p/175238#M33660</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2014-10-07T19:08:03Z</dc:date>
    </item>
  </channel>
</rss>

