<?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: Prevent input to trim values in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935297#M42029</link>
    <description>&lt;P&gt;Technically, your program instructs SAS to read 8 characters:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;numeric_var = input(Patients, 8.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That's what "8." means:&amp;nbsp; read 8 characters.&amp;nbsp; If you want SAS to read a different number of characters, that's the statement to change, perhaps to one of.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;numeric_var = input(Patients, 9.);
numeric_var = input(Patients, 11.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The solution from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;will work.&amp;nbsp; But technically, "best32." is a format, not an informat.&amp;nbsp; So SAS just changes "best32." automatically to be "32." and gets the proper result.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 11:30:36 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2024-07-10T11:30:36Z</dc:date>
    <item>
      <title>Prevent input to trim values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935284#M42026</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to convert a character variable to numeric.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The variable represents IDs (i.e., anonymized patients) I received from an hospital.&lt;/P&gt;
&lt;P&gt;While converting to numeric, the last value is trimmed. For example:&amp;nbsp;800501185 becomes&amp;nbsp;80050118. Is there a way to prevent the trimming?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the code I'm using:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data myDATA;
  set myDATA;
  numeric_var = input(Patients, 8.);
  put numeric_var=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Original variable "Patients": Char $11.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 09:07:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935284#M42026</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2024-07-10T09:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent input to trim values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935285#M42027</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data myDATA;
  Patients='800501185';
  numeric_var = input(Patients, best32.);
  put numeric_var=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2024 09:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935285#M42027</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-07-10T09:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent input to trim values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935286#M42028</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="6"&gt;&lt;STRONG&gt;DON'T.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Patient ID's are&amp;nbsp;&lt;EM&gt;codes&lt;/EM&gt;, not numbers, and should always be stored as character. You will never do calculations with them, but numeric might lead to imprecisions or loss of information (like leading zeroes).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 09:35:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935286#M42028</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-07-10T09:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent input to trim values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935297#M42029</link>
      <description>&lt;P&gt;Technically, your program instructs SAS to read 8 characters:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;numeric_var = input(Patients, 8.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That's what "8." means:&amp;nbsp; read 8 characters.&amp;nbsp; If you want SAS to read a different number of characters, that's the statement to change, perhaps to one of.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;numeric_var = input(Patients, 9.);
numeric_var = input(Patients, 11.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The solution from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;will work.&amp;nbsp; But technically, "best32." is a format, not an informat.&amp;nbsp; So SAS just changes "best32." automatically to be "32." and gets the proper result.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 11:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Prevent-input-to-trim-values/m-p/935297#M42029</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2024-07-10T11:30:36Z</dc:date>
    </item>
  </channel>
</rss>

