<?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 do I save Number to Character in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498776#M132627</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215780"&gt;@RBJ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello! If i have a dataset with numbers having two places after decimal, say, 6, 6.1, 6.12 but I want to save them as characters so that they are save as 6.0, 6.10, and 6.12. How can I do that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The problem here (unless you have mis-typed the problem), is that you don't have two decimal places, the resulting first number you say is 6.0 which has one decimal place. So, is this a typo?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want 6.00, 6.10 and 6.12, then the answers have been given. If you really want 6.0, 6.10 and 6.12, you would need to perform some IF statements so that exactly six is formatted as (for example) 5.1, while 6.10 and 6.12 are formatted as 5.2, and given what you have told us, this can't be generalized without more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the accepted solution, I don't think the Z is needed in the format at all. The Z format adds nothing to this problem.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Sep 2018 18:15:19 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-09-25T18:15:19Z</dc:date>
    <item>
      <title>How do I save Number to Character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498771#M132624</link>
      <description>&lt;P&gt;Hello! If i have a dataset with numbers having two places after decimal, say, 6, 6.1, 6.12 but I want to save them as characters so that they are save as 6.0, 6.10, and 6.12. How can I do that? Is there a SAS function for that? The same when I have numbers with 3 places after the decimal. For example, if the numbers are 6, 6.1, 6.12, and 6.134, I will like to save them as 6.000, 6.100, 6.120, and 6.134. How can I do that?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 16:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498771#M132624</guid>
      <dc:creator>RBJ</dc:creator>
      <dc:date>2018-09-25T16:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save Number to Character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498773#M132625</link>
      <description>&lt;P&gt;You can use Z format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE;
INPUT X;
Y=PUT(X,Z4.2);
Z=PUT(X,Z5.3);
DATALINES;
6
6.1
6.12
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2018 16:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498773#M132625</guid>
      <dc:creator>muratatik</dc:creator>
      <dc:date>2018-09-25T16:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save Number to Character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498774#M132626</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dsd;
input num @@;
char=put(num,f12.3 -l);
cards;
6, 6.1, 6.12 
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2018 16:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498774#M132626</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-25T16:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save Number to Character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498776#M132627</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215780"&gt;@RBJ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello! If i have a dataset with numbers having two places after decimal, say, 6, 6.1, 6.12 but I want to save them as characters so that they are save as 6.0, 6.10, and 6.12. How can I do that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The problem here (unless you have mis-typed the problem), is that you don't have two decimal places, the resulting first number you say is 6.0 which has one decimal place. So, is this a typo?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want 6.00, 6.10 and 6.12, then the answers have been given. If you really want 6.0, 6.10 and 6.12, you would need to perform some IF statements so that exactly six is formatted as (for example) 5.1, while 6.10 and 6.12 are formatted as 5.2, and given what you have told us, this can't be generalized without more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the accepted solution, I don't think the Z is needed in the format at all. The Z format adds nothing to this problem.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 18:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498776#M132627</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-09-25T18:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save Number to Character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498786#M132630</link>
      <description>&lt;P&gt;That worked. Simple.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 18:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498786#M132630</guid>
      <dc:creator>RBJ</dc:creator>
      <dc:date>2018-09-25T18:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save Number to Character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498787#M132631</link>
      <description>&lt;P&gt;That worked too. Simple.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 18:02:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-save-Number-to-Character/m-p/498787#M132631</guid>
      <dc:creator>RBJ</dc:creator>
      <dc:date>2018-09-25T18:02:38Z</dc:date>
    </item>
  </channel>
</rss>

