<?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 replace a character value with a range of numeric values? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920232#M41225</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464161"&gt;@Bumble_15&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;This may be a silly question, but I have a dataset with a variable "age" that is continuous, but contains "&amp;lt;1". I am looking to replace the "&amp;lt;1" with a range of numeric values (0.3-0.7).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure of the best way to go about this; my initial thought was multiple imputation (proc MI), but I think there must also be another (simpler) way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You seem confused about what you have.&amp;nbsp; If the value has a &amp;lt; in it then it is NOT a number.&amp;nbsp; It is a character string.&amp;nbsp; If the new value has a hyphen in it then it is also not a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you want to replace the string '&amp;lt;1' with the string '0.3-0.7'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As long as AGE is defined long enough to hold that longer string it should be easy.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  if age='&amp;lt;1' then age='0.3-0.7';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 03:24:46 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-03-14T03:24:46Z</dc:date>
    <item>
      <title>How to replace a character value with a range of numeric values?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920165#M41218</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;This may be a silly question, but I have a dataset with a variable "age" that is continuous, but contains "&amp;lt;1". I am looking to replace the "&amp;lt;1" with a range of numeric values (0.3-0.7).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure of the best way to go about this; my initial thought was multiple imputation (proc MI), but I think there must also be another (simpler) way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 18:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920165#M41218</guid>
      <dc:creator>Bumble_15</dc:creator>
      <dc:date>2024-03-13T18:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a character value with a range of numeric values?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920213#M41222</link>
      <description>&lt;P&gt;See if these solutions help:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/24/590.html" target="_blank"&gt;https://support.sas.com/kb/24/590.html&lt;/A&gt;&amp;nbsp;or&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Data-Science/variable-type-change-from-Character-to-numeric/td-p/609724" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Science/variable-type-change-from-Character-to-numeric/td-p/609724&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 22:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920213#M41222</guid>
      <dc:creator>SAS_Cares</dc:creator>
      <dc:date>2024-03-13T22:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a character value with a range of numeric values?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920221#M41224</link>
      <description>&lt;P&gt;According to PROC CONTENTS, is this variable that is named AGE, numeric or character? The only acceptable answer is from PROC CONTENTS. Show us the PROC CONTENTS output.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 00:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920221#M41224</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-14T00:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a character value with a range of numeric values?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920232#M41225</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464161"&gt;@Bumble_15&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;This may be a silly question, but I have a dataset with a variable "age" that is continuous, but contains "&amp;lt;1". I am looking to replace the "&amp;lt;1" with a range of numeric values (0.3-0.7).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure of the best way to go about this; my initial thought was multiple imputation (proc MI), but I think there must also be another (simpler) way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You seem confused about what you have.&amp;nbsp; If the value has a &amp;lt; in it then it is NOT a number.&amp;nbsp; It is a character string.&amp;nbsp; If the new value has a hyphen in it then it is also not a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you want to replace the string '&amp;lt;1' with the string '0.3-0.7'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As long as AGE is defined long enough to hold that longer string it should be easy.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  if age='&amp;lt;1' then age='0.3-0.7';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 03:24:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-replace-a-character-value-with-a-range-of-numeric-values/m-p/920232#M41225</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-14T03:24:46Z</dc:date>
    </item>
  </channel>
</rss>

