<?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: how to find Zip Code? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-Zip-Code/m-p/457335#M284444</link>
    <description>&lt;P&gt;something like below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input zip_Code_start Zip_Code_End  City $40.;
 datalines;
63928 74731 Baden-Württemberg
61111 61798 otherplace
 ;

data two;
input Customer_name $ ZIP_code ;
datalines;
XXXX 69256
yyyy 61212
 ;
 
 proc sql;
 select  b.*, a.city
 from one a
 inner join 
 two b
 on ZIP_code between zip_Code_start  and Zip_Code_End ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Apr 2018 15:05:13 GMT</pubDate>
    <dc:creator>kiranv_</dc:creator>
    <dc:date>2018-04-25T15:05:13Z</dc:date>
    <item>
      <title>how to find Zip Code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-Zip-Code/m-p/457315#M284442</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi together, I need your help please!!!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;1 table with 3 columns.:&amp;nbsp;the&amp;nbsp;Zip_code_star ,&amp;nbsp;Zip_Code_end&amp;nbsp;and the city and in other table&amp;nbsp;I have the&amp;nbsp;Zip_code of my customer but not the city.&lt;/P&gt;&lt;P&gt;I need to get the city of my customer. So I need to proof if the Zip_Code of my Customer is between de intervale from &amp;nbsp;Zip_code_star&amp;nbsp;and&amp;nbsp;Zip_Code_end&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&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ible to do that&amp;nbsp;with proc sql?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;

 

create table total as c

 

select a.Customer_name,a.Zip_Code,b.Zip_Code_star, b.Zip_Code_End

 

from PLZ_Cod as a, Cus_PLZ as b

 

where b.PLZ_an &amp;lt;= a.Zip_Code &amp;lt;= b.PLZ_End ;

 

quit;

 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Ela&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 14:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-Zip-Code/m-p/457315#M284442</guid>
      <dc:creator>laselas</dc:creator>
      <dc:date>2018-04-25T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to find Zip Code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-Zip-Code/m-p/457331#M284443</link>
      <description>&lt;P&gt;what are PLZ_an and PLZ_end? You "sample" says that the variables you want to compare Zipc_ode to are Zip_code_star and Zip_code_end. Also since you called your example data Table 1 and Table 2 we do not know which data set &amp;nbsp;PLZ_Cod&amp;nbsp;or Cus_PLZ is which. I can guess but you should be explicit and consistent in code and references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you have your a and b aliases reversed in&lt;/P&gt;
&lt;P&gt;from PLZ_Cod as a&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; Cus_PLZ as b&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 15:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-Zip-Code/m-p/457331#M284443</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-25T15:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to find Zip Code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-Zip-Code/m-p/457335#M284444</link>
      <description>&lt;P&gt;something like below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input zip_Code_start Zip_Code_End  City $40.;
 datalines;
63928 74731 Baden-Württemberg
61111 61798 otherplace
 ;

data two;
input Customer_name $ ZIP_code ;
datalines;
XXXX 69256
yyyy 61212
 ;
 
 proc sql;
 select  b.*, a.city
 from one a
 inner join 
 two b
 on ZIP_code between zip_Code_start  and Zip_Code_End ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Apr 2018 15:05:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-Zip-Code/m-p/457335#M284444</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-04-25T15:05:13Z</dc:date>
    </item>
  </channel>
</rss>

