<?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 Formatting fields in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215401#M53015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to change a date which is held in a string and of the format 01 DEC 2012 to a SAS date. Is this easy to do? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I have a character field holding number which I would like to convert to number formats. i.e. 1,769 as a character field of length 10.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 May 2015 08:43:45 GMT</pubDate>
    <dc:creator>brophymj</dc:creator>
    <dc:date>2015-05-15T08:43:45Z</dc:date>
    <item>
      <title>Formatting fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215401#M53015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to change a date which is held in a string and of the format 01 DEC 2012 to a SAS date. Is this easy to do? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I have a character field holding number which I would like to convert to number formats. i.e. 1,769 as a character field of length 10.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 08:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215401#M53015</guid>
      <dc:creator>brophymj</dc:creator>
      <dc:date>2015-05-15T08:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215402#M53016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, input reads text and converts to numeric (dates and times are actually numbers), put does the reverse so:&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;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_date=input(compress(string_date),date9.);&amp;nbsp; /* Compress as you have blanks */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_num=input(text_num,best.);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format new_date date9.;&amp;nbsp;&amp;nbsp; /* apply format, otherwise you will see number of days since a date in the past */&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 08:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215402#M53016</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-15T08:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215403#M53017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks rw9, that works for the dates. In the case of a the number it's not working. My number is currently a string of the form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1,569&lt;/P&gt;&lt;P&gt;79&lt;/P&gt;&lt;P&gt;104&lt;/P&gt;&lt;P&gt;1,333&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on. It's working for the numbers with commas but not the other ones.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 08:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215403#M53017</guid>
      <dc:creator>brophymj</dc:creator>
      <dc:date>2015-05-15T08:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting fields</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215404#M53018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, you need to use the comma format then:&lt;/P&gt;&lt;P&gt;&amp;nbsp; new_num=input(text_num,comma8.);&lt;/P&gt;&lt;P&gt;All formats can be found in the online help:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000309859.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000309859.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 09:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-fields/m-p/215404#M53018</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-15T09:08:51Z</dc:date>
    </item>
  </channel>
</rss>

