<?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: (Proc SQL or Data step) with macros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198363#M37153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you a fan of hash tables?&amp;nbsp; I could imagine a DATA step that reads through the Member list, and loads the library list into a hash table.&amp;nbsp; So it reads in a member, rips through the hash table looking for the closest library that has capacity, makes the library assignment (dataset variable), decrements the capacity in the hash table by one. Then the DATA step iterates again and reads the second member etc.&amp;nbsp; Sound reasonable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's in interesting exercise.&amp;nbsp; Is it a homework exercise?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Aug 2015 17:54:27 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2015-08-13T17:54:27Z</dc:date>
    <item>
      <title>(Proc SQL or Data step) with macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198360#M37150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have 2 sets of data with no common variable. One is a list of library members while the other is a list of libraries. Now, for each member, I want to assign the member to a library (and only one library) based on conditions like library capacity, calculated distance between the library and member, etc. The library capacity should be updated (as in reduced by 1) for the particular library after each assignment of a member to it. I am currently stuck at this and will appreciate any help or ideas. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 13:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198360#M37150</guid>
      <dc:creator>Punxsutawney</dc:creator>
      <dc:date>2015-08-13T13:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: (Proc SQL or Data step) with macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198361#M37151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I suggest you show some small sample datasets.&amp;nbsp; When you say library I'm thinking you mean SAS library.&amp;nbsp; But then when I ready more I'm thinking you mean a library building that stores books and the members are people not datasets....&amp;nbsp;&amp;nbsp; Sample data would help.&amp;nbsp; Ideally both sample input data and the desired output.&amp;nbsp;&amp;nbsp; Also sounds like you may need to think about what you are trying to optimize (e.g. assign members to libraries, optimizing the average distance a member needs to travel to reach a library?).&amp;nbsp; Or perhaps you don't really care about optimization, so it is sufficient to just consecutively assign each member to the best of the libraries that have capacity at that time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 15:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198361#M37151</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-08-13T15:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: (Proc SQL or Data step) with macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198362#M37152</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;Thanks for the reply. I meant library as a place that stores books, etc. Sorry about the confusion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Member list&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;mbr_id&amp;nbsp;&amp;nbsp;&amp;nbsp; zipcode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12134&amp;nbsp; &lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12315&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14235&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Library list&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;lib_id&amp;nbsp;&amp;nbsp; zipcode&amp;nbsp;&amp;nbsp; capacity&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12541&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&lt;/P&gt;&lt;P&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14521&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13214&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 43&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't worry about optimization. So what I want to do is assign a library ID to each of these members based on first capacity of the library (max capacity is 46) and distance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 17:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198362#M37152</guid>
      <dc:creator>Punxsutawney</dc:creator>
      <dc:date>2015-08-13T17:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: (Proc SQL or Data step) with macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198363#M37153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you a fan of hash tables?&amp;nbsp; I could imagine a DATA step that reads through the Member list, and loads the library list into a hash table.&amp;nbsp; So it reads in a member, rips through the hash table looking for the closest library that has capacity, makes the library assignment (dataset variable), decrements the capacity in the hash table by one. Then the DATA step iterates again and reads the second member etc.&amp;nbsp; Sound reasonable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's in interesting exercise.&amp;nbsp; Is it a homework exercise?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 17:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-or-Data-step-with-macros/m-p/198363#M37153</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-08-13T17:54:27Z</dc:date>
    </item>
  </channel>
</rss>

