<?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: SAS Character and Numeric and harmonization in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-Character-and-Numeric-and-harmonization/m-p/630129#M20795</link>
    <description>&lt;P&gt;Keep as character.&lt;/P&gt;
&lt;P&gt;Why? A number needs at least 3 bytes for storage, a single character just one.&lt;/P&gt;
&lt;P&gt;Create a format that maps the 5 values to the 4 values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $mconvert
  "1" = "1"
  "2" = "3"
  "3" = "3"
  "4" = "4"
  "5" = "2"
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can use the put() function with the format for converting.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Mar 2020 16:14:39 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-03-06T16:14:39Z</dc:date>
    <item>
      <title>SAS Character and Numeric and harmonization</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Character-and-Numeric-and-harmonization/m-p/630122#M20794</link>
      <description>&lt;P&gt;I have a marriage variable called v1marital in one dataset and v_martial_0 in another.&lt;/P&gt;&lt;P&gt;I am trying to harmonize the variables and also change from character to numeric.&lt;/P&gt;&lt;P&gt;However, the variables have different conditions and I want vmarital=2 to equal 3 =v_marital_0. I'm not sure how to go about this.&lt;/P&gt;&lt;P&gt;V_MARITAL_0&lt;/P&gt;&lt;P&gt;1=single, never married&lt;/P&gt;&lt;P&gt;2=married, co-habituating&lt;/P&gt;&lt;P&gt;3=divorced or separated&lt;/P&gt;&lt;P&gt;4=widowed&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;V1MARITAL&lt;/P&gt;&lt;P&gt;1=single, never married&lt;/P&gt;&lt;P&gt;2=separate&lt;/P&gt;&lt;P&gt;3=divorced or annulled&lt;/P&gt;&lt;P&gt;4=widowed&lt;/P&gt;&lt;P&gt;5=married&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 16:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Character-and-Numeric-and-harmonization/m-p/630122#M20794</guid>
      <dc:creator>mariamon0</dc:creator>
      <dc:date>2020-03-06T16:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Character and Numeric and harmonization</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Character-and-Numeric-and-harmonization/m-p/630129#M20795</link>
      <description>&lt;P&gt;Keep as character.&lt;/P&gt;
&lt;P&gt;Why? A number needs at least 3 bytes for storage, a single character just one.&lt;/P&gt;
&lt;P&gt;Create a format that maps the 5 values to the 4 values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $mconvert
  "1" = "1"
  "2" = "3"
  "3" = "3"
  "4" = "4"
  "5" = "2"
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can use the put() function with the format for converting.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 16:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Character-and-Numeric-and-harmonization/m-p/630129#M20795</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-06T16:14:39Z</dc:date>
    </item>
  </channel>
</rss>

