<?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: change character date and time format into numeric in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542444#M7544</link>
    <description>&lt;P&gt;Sure! The first one is the original data. The second one is the expected output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DateTime and Speed are changed from character to numeric. And plateNumber is changed from numeric to character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your patience!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-03-12 at 10.23.44 AM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27876i40F2CAFBEA88F0CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-03-12 at 10.23.44 AM.png" alt="Screen Shot 2019-03-12 at 10.23.44 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-03-12 at 10.24.22 AM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27877iB6BE2E153590E707/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-03-12 at 10.24.22 AM.png" alt="Screen Shot 2019-03-12 at 10.24.22 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2019 15:28:03 GMT</pubDate>
    <dc:creator>RebeccaJW</dc:creator>
    <dc:date>2019-03-12T15:28:03Z</dc:date>
    <item>
      <title>change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542108#M7480</link>
      <description>&lt;P&gt;I am given a csv file including a character DateTime variable which is of the form&amp;nbsp;&lt;SPAN&gt;2019-01-19 16:26. I need to change it to a numeric datetime variable which is of the form&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1863534360&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have written&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Jan;
	infile "&amp;amp;path." dsd;
	input DateTime;
	datetime = DATETIME(DateTime);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could any one help me find the way to do this? Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 16:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542108#M7480</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-11T16:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542111#M7483</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
char_datetime='2019-01-19 16:26';
num_datetime=input(char_datetime,anydtdtm21.);
*format num_datetime datetime20.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Mar 2019 16:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542111#M7483</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-11T16:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542114#M7484</link>
      <description>&lt;P&gt;A safer controlled method:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data controlled_safe_method;
char_datetime='2019-01-19 16:26';
num_date=input(char_datetime,yymmdd10.);
num_time=input(scan(char_datetime,-1,' '),time5.);
num_datetime=dhms(num_date,0,0,0)+num_time;
*format num_datetime datetime20.;
keep char_datetime num_datetime;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Mar 2019 17:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542114#M7484</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-11T17:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542406#M7535</link>
      <description>&lt;P&gt;Thank you novinosrin! I tried your method. This is what I wrote:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Jan;
	infile "&amp;amp;path." dsd;
	input DateTime;
	datetime = input(DateTime, anydtdtm21.);
	keep datetime;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, there is no values in the DateTime variable. And there is no datetime variable. Could you take a look at it? Thank you so much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-03-12 at 9.28.27 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27871i52E7A0314285239C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2019-03-12 at 9.28.27 AM.png" alt="Screen Shot 2019-03-12 at 9.28.27 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 14:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542406#M7535</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-12T14:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542413#M7536</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/266114"&gt;@RebeccaJW&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Your code&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; Jan&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"&amp;amp;path."&lt;/SPAN&gt; dsd&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token function"&gt;datetime&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; anydtdtm21&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;keep&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;datetime&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;The input statement statement tries to reads your datetime value as a number&lt;STRONG&gt; as you haven't&lt;/STRONG&gt; instructed how the input statement should read the value, i.e either character or numeric. Since your values have characters, you need special instructions to read date/datetime values known as informats.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to read as character and then convert to numeric , your input statement should be like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;input datetime : $21. ;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, If&amp;nbsp; you want to read as number directly,&amp;nbsp;your input statement should be like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;input datetime : anydtdtm21.;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try one of the two and let me know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 14:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542413#M7536</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-12T14:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542423#M7538</link>
      <description>&lt;P&gt;Thank you for replying! This is what I have tried. I kind of get the idea, but the result is still not correct... It turns out to be the first column of the .csv file, which is not DateTime. And the DateTime is still characteristic. Is this the problem with the informat statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Jan;
	infile "&amp;amp;path." dsd;
	input DateTime :$21.;
	informat DateTime :ANYDTDTM21. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-03-12 at 10.00.10 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27873i1AAE3D275435A247/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2019-03-12 at 10.00.10 AM.png" alt="Screen Shot 2019-03-12 at 10.00.10 AM.png" /&gt;&lt;/span&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542423#M7538</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-12T15:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542433#M7541</link>
      <description>&lt;P&gt;Can you post a 2 or 3 records of your csv file if that's not violating any data security policy or atleast a mock data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can help you with the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post your &lt;U&gt;&lt;STRONG&gt;expected output&lt;/STRONG&gt; &lt;/U&gt;with that&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:22:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542433#M7541</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-12T15:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542444#M7544</link>
      <description>&lt;P&gt;Sure! The first one is the original data. The second one is the expected output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DateTime and Speed are changed from character to numeric. And plateNumber is changed from numeric to character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your patience!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-03-12 at 10.23.44 AM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27876i40F2CAFBEA88F0CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-03-12 at 10.23.44 AM.png" alt="Screen Shot 2019-03-12 at 10.23.44 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-03-12 at 10.24.22 AM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27877iB6BE2E153590E707/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-03-12 at 10.24.22 AM.png" alt="Screen Shot 2019-03-12 at 10.24.22 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542444#M7544</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-12T15:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542450#M7545</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/266114"&gt;@RebeccaJW&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Jan;
	infile "&amp;amp;path." dsd truncover;
	input make :$10. model  : $30. year DateTime :ANYDTDTM21. speed platenumber :$12.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542450#M7545</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-12T15:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542537#M7564</link>
      <description>&lt;P&gt;Thank you for answering! It works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I ask a short question about how to change the speed from 1+ to +1 and 6- to -6 like this? Right now, my thought is to use value in proc format. I am wondering if there is any other more efficient methods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 18:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542537#M7564</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-12T18:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542540#M7566</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;how to change the speed from 1+ to +1 and 6- to -6 like this?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you want that a numeric variable or char variable?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would assume it's easy to keep speed as numeric variable from the very meaning of speed however if for any reason your context has&amp;nbsp; some kind of an indicator with discrete values, then you could have them formatted. So basically, that's where domain knowledge matters&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 18:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542540#M7566</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-12T18:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542544#M7567</link>
      <description>&lt;P&gt;If you just want to reverse position + and - from suffix to prefix&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data w;
input char_num $;
length want $8;
want=cats(compress(char_num,,'d'),compress(char_num,,'kd'));
cards;
6+
6-
0
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 18:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542544#M7567</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-12T18:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542547#M7568</link>
      <description>&lt;P&gt;Thank you for your reply! I also need to change the speed from character to numeric. So I did this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	value $Speed '12-' = -12
		     '11+' = +11;
run;

data Jan;
	infile "&amp;amp;path." dsd truncover firstobs=2;
	input make :$10. model  : $30. year DateTime :ANYDTDTM21. speed $ plateNumber :$10.;
	format speed Speed.;
	informat speed = input(speed, BEST.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But there are errors when I want to change speed from character to numeric.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 19:05:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542547#M7568</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-12T19:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542549#M7569</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/266114"&gt;@RebeccaJW&lt;/a&gt;&amp;nbsp; &amp;nbsp;Now you are talking lol&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your requirement-&lt;STRONG&gt;&lt;EM&gt;"I want to change &lt;/EM&gt;&lt;U&gt;speed&lt;/U&gt; &lt;EM&gt;from character to numeric."&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try using&amp;nbsp; trailsgn8. informat, straight forward and simple&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
input num_speed trailsgn8.;
cards;
6+
6-
0
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Apply the above example in your original code. No need for formats or any sort of character manipulation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that helps.&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 19:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542549#M7569</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-12T19:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: change character date and time format into numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542551#M7570</link>
      <description>Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;! I will try it! I really appreciate your help!</description>
      <pubDate>Tue, 12 Mar 2019 19:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/change-character-date-and-time-format-into-numeric/m-p/542551#M7570</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-12T19:16:34Z</dc:date>
    </item>
  </channel>
</rss>

