<?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 How to convert 5ft.4in.(Char) into inches(Num); in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25154#M4352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The context help is certainly useful. These PRX functions are part of a grander topic called the Perl regular expressions (hence the name). The SAS support site provides the much needed background at &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002288677.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002288677.htm&lt;/A&gt;. There are some very useful SAS Forum papers as well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that regular expressions (regexp's) are not invented by SAS; a Google search will illustrate this. So there is are lots of resources outside the SAS realm that can be helpful. I must admit regexp's are an acquired taste, but their power is certainly worth the effort. And who hasn't occasionally used the mother of all regexps: "*.*"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Jan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jul 2011 16:19:01 GMT</pubDate>
    <dc:creator>jklaverstijn</dc:creator>
    <dc:date>2011-07-04T16:19:01Z</dc:date>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25149#M4347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset which consists of Height variable. Data type of height is Char.sample data values of Height var. are 5ft. 4in. , 6ft. 10in.&lt;/P&gt;&lt;P&gt;I have to convert these char values into numeric values. final output : the datavalues should be in inches.&lt;/P&gt;&lt;P&gt;Could you please help me regarding this problem.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jul 2011 09:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25149#M4347</guid>
      <dc:creator>john83</dc:creator>
      <dc:date>2011-07-02T09:09:57Z</dc:date>
    </item>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25150#M4348</link>
      <description>&lt;P&gt;Short of moving to a country that has a decent metric system in place, I suggest using regular a expression. This shoud hopefully get you started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Courier New; font-size: 10pt;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt; _n_ = &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; re = prxparse(&lt;SPAN style="color: #800080;"&gt;'/(\d*)ft. (\d*)in./'&lt;/SPAN&gt;); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;retain&lt;/SPAN&gt; re;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;input&lt;/SPAN&gt; ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt; prxmatch(re, _infile_) &lt;SPAN style="color: #0000ff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feet = prxposn(re, &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;, _infile_);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inches = prxposn(re, &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;, _infile_);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;put&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;_all_&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;cards&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; background-color: #ffffc0; font-family: Courier New;"&gt;5ft. 4in.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; background-color: #ffffc0; font-family: Courier New;"&gt;6ft. 10in.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I leave it as an excercise for the reader to convert from num to char and from feet to inches.&lt;/P&gt;
&lt;P&gt;Regards, Jan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Editor's note: Challenge accepted.&amp;nbsp; See &lt;/EM&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2019/02/08/convert-text-to-number/" target="_self"&gt;Convert a text-based measurement to a number in SAS&lt;/A&gt;&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 17:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25150#M4348</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2019-02-08T17:56:37Z</dc:date>
    </item>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25151#M4349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help. &lt;/P&gt;&lt;P&gt;If you have time, could you please tell me , what are prxparse,prxposn and prxmatch functions.&lt;/P&gt;&lt;P&gt;Your help will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Jul 2011 07:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25151#M4349</guid>
      <dc:creator>john83</dc:creator>
      <dc:date>2011-07-03T07:58:56Z</dc:date>
    </item>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25152#M4350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data want;
input height $20.;
num_height=input(scan(height,1,,'kd'),best8.)*12+input(scan(height,2,,'kd'),best8.);
cards;
5ft. 4in.
6ft. 10in.
;run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 03:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25152#M4350</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-07-04T03:23:06Z</dc:date>
    </item>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25153#M4351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to find out about a function type it and press F1 key (while the cursor is at the function name)&lt;/P&gt;&lt;P&gt;But do this in a SAS editor. &lt;/P&gt;&lt;P&gt;SAS editors provide context sensitive help &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 15:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25153#M4351</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-07-04T15:54:48Z</dc:date>
    </item>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25154#M4352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The context help is certainly useful. These PRX functions are part of a grander topic called the Perl regular expressions (hence the name). The SAS support site provides the much needed background at &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002288677.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002288677.htm&lt;/A&gt;. There are some very useful SAS Forum papers as well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that regular expressions (regexp's) are not invented by SAS; a Google search will illustrate this. So there is are lots of resources outside the SAS realm that can be helpful. I must admit regexp's are an acquired taste, but their power is certainly worth the effort. And who hasn't occasionally used the mother of all regexps: "*.*"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Jan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 16:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25154#M4352</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2011-07-04T16:19:01Z</dc:date>
    </item>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25155#M4353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the Info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 09:07:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25155#M4353</guid>
      <dc:creator>john83</dc:creator>
      <dc:date>2011-07-15T09:07:03Z</dc:date>
    </item>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25156#M4354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Sure I will google it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 09:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25156#M4354</guid>
      <dc:creator>john83</dc:creator>
      <dc:date>2011-07-15T09:07:45Z</dc:date>
    </item>
    <item>
      <title>How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25157#M4355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 09:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/25157#M4355</guid>
      <dc:creator>john83</dc:creator>
      <dc:date>2011-07-15T09:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 5ft.4in.(Char) into inches(Num);</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/368947#M88002</link>
      <description>&lt;P&gt;Hi. What does 'kd' and best stands for in your code. thanks&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 20:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-5ft-4in-Char-into-inches-Num/m-p/368947#M88002</guid>
      <dc:creator>id1887</dc:creator>
      <dc:date>2017-06-20T20:55:38Z</dc:date>
    </item>
  </channel>
</rss>

