<?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 Change Format of Column in SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195050#M266399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can anyone suggest me any function in SAS similar to Text function in excel. I need to change the format of the coulmn in SAS. &lt;/P&gt;&lt;P&gt;For eg from excel point of view, I would like to do something like this TEXT(A1,"00000").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if anything can done like this in SAS. Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jul 2015 09:05:47 GMT</pubDate>
    <dc:creator>vishal09</dc:creator>
    <dc:date>2015-07-03T09:05:47Z</dc:date>
    <item>
      <title>How to Change Format of Column in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195050#M266399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can anyone suggest me any function in SAS similar to Text function in excel. I need to change the format of the coulmn in SAS. &lt;/P&gt;&lt;P&gt;For eg from excel point of view, I would like to do something like this TEXT(A1,"00000").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if anything can done like this in SAS. Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2015 09:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195050#M266399</guid>
      <dc:creator>vishal09</dc:creator>
      <dc:date>2015-07-03T09:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Format of Column in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195051#M266400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to provide some more information, preferable before and after data in the form of a datastep.&amp;nbsp; The reason is you can easily change the format of a column assuming that that column has data which is acceptable to the new format e.g:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length col $5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col="123"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col="456"; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col_to_num=input(col,best.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format col_to_num 6.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if your character data contained letters or non-numeric you would get missing, or have to error handle it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2015 09:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195051#M266400</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-03T09:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Format of Column in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195052#M266401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vishan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understood you correctly, you cannot change a specific value from numeric to character. If need one has to apply the format to the variable and it applies to all values within that variable.&lt;/P&gt;&lt;P&gt;So if you have numeric column(right aligned) you can convert the same to character(left aligned) by&lt;STRONG&gt; PUT function.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = 111; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = 222; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data test1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; y = put(x, 3.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; put y =;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this suffices your requirement. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Br,Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2015 10:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195052#M266401</guid>
      <dc:creator>AmitRathore</dc:creator>
      <dc:date>2015-07-03T10:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Format of Column in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195053#M266402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot. This worked for me. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2015 10:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Format-of-Column-in-SAS/m-p/195053#M266402</guid>
      <dc:creator>vishal09</dc:creator>
      <dc:date>2015-07-03T10:57:19Z</dc:date>
    </item>
  </channel>
</rss>

