<?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: Need help with Merge in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195799#M266481</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table data pobox_coded as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select a.*, b.zip5 as po_zip5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; pob as a left join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; pobox_zip as b&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; on a.city_code=b.city_code and &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; pob between PO_from and PO_to;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(untested)&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 05 Jul 2015 20:01:07 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2015-07-05T20:01:07Z</dc:date>
    <item>
      <title>Need help with Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195796#M266478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I have a file (pobox_zip) that converts a city/PO box range to a new zip.&amp;nbsp; This input&amp;nbsp; file has ranges of PO boxes within each city, and each range is a separate record.&lt;/P&gt;&lt;P&gt;I have a second input fie that contains specific city/po box numbers and I want to match them to file 1 above by city/PO box and derive the new zip code.&lt;/P&gt;&lt;P&gt;The merge code below is not working.&amp;nbsp;&amp;nbsp; This is a many to many merge at the city code level.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="mso-bidi-language: HE; color: navy; font-size: 12pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt; pobox_coded;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;merge&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt; pob (&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;=a) pobox_zip (&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;=b);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt; city_code;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt; a and b &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/* a and b means city code match....now look for a PO box range match*/&lt;/P&gt;&lt;P&gt;/* POB is PO box #; PO_from and PO_to are ranges of PO boxes*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt; pob &amp;gt;=PO_from and pob &amp;lt;= PO_to &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;pob_hit=&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-language: HE; color: teal; font-size: 12pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;po_zip5=zip5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="mso-bidi-language: HE; color: navy; font-size: 12pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 12pt; mso-bidi-language: HE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2015 04:47:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195796#M266478</guid>
      <dc:creator>steveg1</dc:creator>
      <dc:date>2015-07-05T04:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195797#M266479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For many to many merges never use the data step.&amp;nbsp; Use SQL instead. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2015 07:08:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195797#M266479</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-07-05T07:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195798#M266480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;What would the SQL code look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2015 07:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195798#M266480</guid>
      <dc:creator>steveg1</dc:creator>
      <dc:date>2015-07-05T07:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195799#M266481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table data pobox_coded as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select a.*, b.zip5 as po_zip5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; pob as a left join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; pobox_zip as b&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; on a.city_code=b.city_code and &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; pob between PO_from and PO_to;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(untested)&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2015 20:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195799#M266481</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-07-05T20:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195800#M266482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;BR /&gt;With a very minor adjustment the code worked.&lt;/P&gt;&lt;P&gt;Thanks for the tip.&lt;/P&gt;&lt;P&gt;I have used SAS in many to many merges, and it seems fine for match/append data.&amp;nbsp; Strange that i does not work for range data.&lt;/P&gt;&lt;P&gt;Stev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 03:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195800#M266482</guid>
      <dc:creator>steveg1</dc:creator>
      <dc:date>2015-07-10T03:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195801#M266483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are your PObox variables actually numeric? If they were character you can get very poor results with &amp;gt; or &amp;lt; comparisons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-Merge/m-p/195801#M266483</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-10T15:44:39Z</dc:date>
    </item>
  </channel>
</rss>

