<?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 format date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326821#M72855</link>
    <description>&lt;P&gt;Good Afternoon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following date format mm.yyyy (e.g 08.1960) and I need to put into the format of yyyy-mm (e.g 08-1960).&amp;nbsp; I have already done the following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TEST1c; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;SET&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TEST1B;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;DOB= INPUT (DOB, &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;FORMAT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DOB &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yymmd.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;It does not seem to be working. Any help is appreciated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thank you&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2017 19:48:28 GMT</pubDate>
    <dc:creator>biotelemetry</dc:creator>
    <dc:date>2017-01-23T19:48:28Z</dc:date>
    <item>
      <title>format date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326821#M72855</link>
      <description>&lt;P&gt;Good Afternoon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following date format mm.yyyy (e.g 08.1960) and I need to put into the format of yyyy-mm (e.g 08-1960).&amp;nbsp; I have already done the following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TEST1c; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;SET&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TEST1B;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;DOB= INPUT (DOB, &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;FORMAT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DOB &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yymmd.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;It does not seem to be working. Any help is appreciated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thank you&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 19:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326821#M72855</guid>
      <dc:creator>biotelemetry</dc:creator>
      <dc:date>2017-01-23T19:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: format date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326827#M72857</link>
      <description>&lt;P&gt;Your question is similar to the next post. See solution there:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Informat-for-date-in-the-form-MM-YYYY/m-p/326564" target="_self"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Informat-for-date-in-the-form-MM-YYYY/m-p/326564&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 20:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326827#M72857</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-23T20:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: format date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326834#M72862</link>
      <description>&lt;P&gt;You should describe how something "is not working". Error? Post log and error message&amp;nbsp;No output? Post log and any warnings or messages&amp;nbsp;Unexpected output? Post input data and expected output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Very likely your DOB variabe is numeric. You cannot have a character and numeric variable in a dataset with the same name which you attempted with the INPUT and a $ informat. Also Format with a datetype format is only going to work with a numeric value and will only make sense if the variable were read correctly. FORMATS control how the value is displayed, it does not change the actual content.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 20:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326834#M72862</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-23T20:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: format date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326842#M72864</link>
      <description>&lt;P&gt;If you have a character string "08.1960" that you want to change to "08-1960" that is pretty easy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dob = translate(dob, '-', '.');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What you have is not clear.&amp;nbsp; Is DOB actually a date, or is it a character string?&lt;/LI&gt;
&lt;LI&gt;What you want is not clear.&amp;nbsp; The "08-1960" is not a match for "yyyy-mm"&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You might start by running PROC CONTENTS on your data set and describing the results for DOB.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 20:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-date/m-p/326842#M72864</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-23T20:36:43Z</dc:date>
    </item>
  </channel>
</rss>

