<?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: ‘Num’ to ‘Text’ or ‘Text’ to ‘Num’ convert in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503109#M134388</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/219549"&gt;@zimcom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I use SAS 9, in the dataset view columns, it dose show as 'Text'.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have tried to use&amp;nbsp;PUT() converts a number to character and INPUT()&amp;nbsp;to convert a character to a number, and rename the variable after, but the merge is not successful, I am wondering if all the length, format and informat properties should also be the same.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="convert.JPG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23933i26B55DA799E16ACF/image-size/small?v=v2&amp;amp;px=200" role="button" title="convert.JPG" alt="convert.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, PUT()/INPUT()&amp;nbsp; should work. Post your code and log, you likely have a mistake somewhere.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Oct 2018 14:47:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-10-10T14:47:05Z</dc:date>
    <item>
      <title>‘Num’ to ‘Text’ or ‘Text’ to ‘Num’ convert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503040#M134364</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to merge two datasets with the variable ‘Subject’, but ‘Subject’ variable appear to be different type in each dataset as below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Column Name&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Type&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Length&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Format&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Informat&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Subject&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Text&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;$8.&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;$8.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Column Name&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Type&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Length&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Format&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Informat&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Subject&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Num&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;BEST12.&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;BEST32.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone tell me how I can convert the type ‘Num’ to ‘Text’ or ‘Text’ to ‘Num’, please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 12:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503040#M134364</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2018-10-10T12:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: ‘Num’ to ‘Text’ or ‘Text’ to ‘Num’ convert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503045#M134368</link>
      <description>What software are you using? SAS has char and num, not ’text’.&lt;BR /&gt;&lt;BR /&gt;If you’re using SAS PUT() converts a number to character and INPUT() is used to convert a character to a number. SAS doesn’t allow for the variable to change types so you need to Rename it as well.</description>
      <pubDate>Wed, 10 Oct 2018 12:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503045#M134368</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-10T12:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: ‘Num’ to ‘Text’ or ‘Text’ to ‘Num’ convert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503049#M134369</link>
      <description>&lt;P&gt;I use SAS 9, in the dataset view columns, it dose show as 'Text'.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried to use&amp;nbsp;PUT() converts a number to character and INPUT()&amp;nbsp;to convert a character to a number, and rename the variable after, but the merge is not successful, I am wondering if all the length, format and informat properties should also be the same.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="convert.JPG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23933i26B55DA799E16ACF/image-size/small?v=v2&amp;amp;px=200" role="button" title="convert.JPG" alt="convert.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 12:28:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503049#M134369</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2018-10-10T12:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: ‘Num’ to ‘Text’ or ‘Text’ to ‘Num’ convert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503076#M134379</link>
      <description>&lt;P&gt;The best solution is to create the datasets using the right types.&lt;/P&gt;
&lt;P&gt;Otherwise it is probably best to convert them both to numbers.&amp;nbsp; There are no formatting issues with numbers.&lt;/P&gt;
&lt;P&gt;The problem with converting the number to text is how do you format the numbers.&amp;nbsp; Are they integers? Do they have leading zeros? Leading spaces?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 13:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503076#M134379</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-10T13:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: ‘Num’ to ‘Text’ or ‘Text’ to ‘Num’ convert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503109#M134388</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/219549"&gt;@zimcom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I use SAS 9, in the dataset view columns, it dose show as 'Text'.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have tried to use&amp;nbsp;PUT() converts a number to character and INPUT()&amp;nbsp;to convert a character to a number, and rename the variable after, but the merge is not successful, I am wondering if all the length, format and informat properties should also be the same.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="convert.JPG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23933i26B55DA799E16ACF/image-size/small?v=v2&amp;amp;px=200" role="button" title="convert.JPG" alt="convert.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, PUT()/INPUT()&amp;nbsp; should work. Post your code and log, you likely have a mistake somewhere.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503109#M134388</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-10T14:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: ‘Num’ to ‘Text’ or ‘Text’ to ‘Num’ convert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503134#M134397</link>
      <description>&lt;P&gt;Here you can go ...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input subject;
datalines;
1
2
3
;
run;

data have2;
input subject $;&lt;BR /&gt;
datalines;
1
2
3
;
run;

data have3 (drop=subject);
set have2;
subject1=input(subject,8.);
run;

data want;
merge have1(in=a) have3(in=b rename=(subject1=subject));
by subject;
if a and b;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503134#M134397</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-10-10T15:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: ‘Num’ to ‘Text’ or ‘Text’ to ‘Num’ convert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503156#M134405</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153275"&gt;@singhsahab&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all and have a great day!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 16:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Num-to-Text-or-Text-to-Num-convert/m-p/503156#M134405</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2018-10-10T16:32:45Z</dc:date>
    </item>
  </channel>
</rss>

