<?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 Creating Macro variables based on min max of id field in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macro-variables-based-on-min-max-of-id-field/m-p/42796#M11147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table that has a column called keyid.&amp;nbsp; I need to get the min and max of this field into macro variables so I can use them in a where clause against different tables that also have this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently doing it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint ;&lt;/P&gt;&lt;P&gt;select min(keyid) into :min_keyid&lt;/P&gt;&lt;P&gt;from tblRaw&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;select max(keyid) into :max_keyid&lt;/P&gt;&lt;P&gt;from tblRaw;&lt;/P&gt;&lt;P&gt;quit ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a better way to do this?&amp;nbsp; I can't seem to get both variables assigned with just 1 proc sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2011 14:28:04 GMT</pubDate>
    <dc:creator>jerry898969</dc:creator>
    <dc:date>2011-08-04T14:28:04Z</dc:date>
    <item>
      <title>Creating Macro variables based on min max of id field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macro-variables-based-on-min-max-of-id-field/m-p/42796#M11147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table that has a column called keyid.&amp;nbsp; I need to get the min and max of this field into macro variables so I can use them in a where clause against different tables that also have this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently doing it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint ;&lt;/P&gt;&lt;P&gt;select min(keyid) into :min_keyid&lt;/P&gt;&lt;P&gt;from tblRaw&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;select max(keyid) into :max_keyid&lt;/P&gt;&lt;P&gt;from tblRaw;&lt;/P&gt;&lt;P&gt;quit ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a better way to do this?&amp;nbsp; I can't seem to get both variables assigned with just 1 proc sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 14:28:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macro-variables-based-on-min-max-of-id-field/m-p/42796#M11147</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2011-08-04T14:28:04Z</dc:date>
    </item>
    <item>
      <title>Creating Macro variables based on min max of id field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macro-variables-based-on-min-max-of-id-field/m-p/42797#M11148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint ;&lt;/P&gt;&lt;P&gt;select min(keyid),max(keyid) into :min_keyid,:max_keyid&lt;/P&gt;&lt;P&gt;from tblRaw&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 14:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macro-variables-based-on-min-max-of-id-field/m-p/42797#M11148</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-04T14:40:54Z</dc:date>
    </item>
    <item>
      <title>Creating Macro variables based on min max of id field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macro-variables-based-on-min-max-of-id-field/m-p/42798#M11149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you that was it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 14:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macro-variables-based-on-min-max-of-id-field/m-p/42798#M11149</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2011-08-04T14:54:33Z</dc:date>
    </item>
  </channel>
</rss>

