<?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: Handling misssing values in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190443#M3952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share part of the two datafiles and an example of how the final output should look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jul 2014 03:27:54 GMT</pubDate>
    <dc:creator>pronabesh</dc:creator>
    <dc:date>2014-07-24T03:27:54Z</dc:date>
    <item>
      <title>Handling misssing values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190442#M3951</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 am fairly new to data cleaning. I want to update the missing values in the master file for a variable (county code) with values from another dataset. In both files , a corresponding zip code has a corresponding county code. I do not have a unique identifier for the files , so I cannot merge them. The master file has a unique identifier and has about 85,000 unique records for a state . There could be multiple records in the master file who have the same zip code and same county. I want to replace the " missing county value" for a "non-missing zip code". The transaction file has a corresponding county for each unique zip code. Two different zip code could lie in the same county. I need your suggestions for the code to help me do this. Please advice.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;DR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 20:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190442#M3951</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2014-07-22T20:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Handling misssing values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190443#M3952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share part of the two datafiles and an example of how the final output should look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 03:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190443#M3952</guid>
      <dc:creator>pronabesh</dc:creator>
      <dc:date>2014-07-24T03:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Handling misssing values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190444#M3953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , Thanks for your reply. I have attached an excel sheet with a example of the layout of master file. transaction file and output file. The master file is a huge data set with unique ID. It has three different fields each for zip code and county labeled zip1 and county1, zip2 and county2 and zip3 and county3 for three different addresses for the individual. The transaction file has information for the county corresponding to a respective zip code. The transaction file is smaller than the master file. It has two fields zip and county. With the help of the transaction file , I want to assign a county value to missing county1, county2 county3 fields in the master file. Each of the fields zip1, zip2, zip3 and zip have $3 format and county1, county2, county3 and county field have a $5 format. I hope my explanation helps. Please let me know if you have any questions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 08:08:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190444#M3953</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2014-07-24T08:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Handling misssing values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190445#M3954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about a HASH TABLE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA MASTER;&lt;/P&gt;&lt;P&gt;INFILE DATALINES DLM=",";&lt;/P&gt;&lt;P&gt;INPUT ID $ ZIP1 COUNTY1 ZIP2 COUNTY2 ZIP3 COUNTY3;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;ER001,30345,145,36751,.,39768,165&lt;/P&gt;&lt;P&gt;ER002,30546,162,37654,.,38765,177&lt;/P&gt;&lt;P&gt;ER003,30357,176,39768,165,35505,154&lt;/P&gt;&lt;P&gt;ER004,30345,.,38765,177,35674,122&lt;/P&gt;&lt;P&gt;ER005,30578,189,35505,154,35555,134&lt;/P&gt;&lt;P&gt;ER006,39820,089,35674,122,34545,59&lt;/P&gt;&lt;P&gt;ER007,39145,121,35555,134,36751,&lt;/P&gt;&lt;P&gt;ER008,36102,063,34545,059,35654,&lt;/P&gt;&lt;P&gt;ER009,36102,063,34545,059,35654,&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TRANSACTION;&lt;/P&gt;&lt;P&gt;INFILE DATALINES DLM="," MISSOVER;&lt;/P&gt;&lt;P&gt;INPUT ZIP COUNTY;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;30345,244&lt;/P&gt;&lt;P&gt;36751,255&lt;/P&gt;&lt;P&gt;37654,233&lt;/P&gt;&lt;P&gt;30345,145&lt;/P&gt;&lt;P&gt;30546,162&lt;/P&gt;&lt;P&gt;30357,176&lt;/P&gt;&lt;P&gt;30578,189&lt;/P&gt;&lt;P&gt;39820,089&lt;/P&gt;&lt;P&gt;39145,121&lt;/P&gt;&lt;P&gt;36102,063&lt;/P&gt;&lt;P&gt;39768,165&lt;/P&gt;&lt;P&gt;38765,177&lt;/P&gt;&lt;P&gt;35505,154&lt;/P&gt;&lt;P&gt;35674,122&lt;/P&gt;&lt;P&gt;35555,134&lt;/P&gt;&lt;P&gt;34545,059&lt;/P&gt;&lt;P&gt;35654,192&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;IF 0 THEN SET TRANSACTION;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF _N_ = 1 THEN DO;&lt;/P&gt;&lt;P&gt;DECLARE HASH H(DATASET:"TRANSACTION");&lt;/P&gt;&lt;P&gt;H.DEFINEKEY("ZIP");&lt;/P&gt;&lt;P&gt;H.DEFINEDATA("ZIP","COUNTY");&lt;/P&gt;&lt;P&gt;H.DEFINEDONE();&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO UNTIL (EOF);&lt;/P&gt;&lt;P&gt;SET MASTER END=EOF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ARRAY _COUNTY&amp;nbsp; {*} COUNTY1-COUNTY3;&lt;/P&gt;&lt;P&gt;ARRAY _ZIP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {*} ZIP1-ZIP3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO I = 1 TO 3;&lt;/P&gt;&lt;P&gt;IF _COUNTY{I} = . THEN DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp; RC = H.FIND(KEY:_ZIP{I});&lt;/P&gt;&lt;P&gt;&amp;nbsp; _COUNTY{I} = COUNTY;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;OUTPUT;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 09:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190445#M3954</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-07-24T09:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Handling misssing values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190446#M3955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion Scott. I am going to try this. Also, I should have mentioned this initially, my master and transaction datasets are SAS datasets. The zip code and county code are not labeled sequentially. But, I will just rename them and use your code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 20:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Handling-misssing-values/m-p/190446#M3955</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2014-07-24T20:15:24Z</dc:date>
    </item>
  </channel>
</rss>

