<?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: error in converting text date column d/mm/yyyy to SAS date column YYYYMMM in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385540#M92237</link>
    <description>&lt;P&gt;data have;&lt;BR /&gt;input period : ddmmyy10. (item_code patient_cat prescriptions) ($);&lt;BR /&gt;&lt;STRONG&gt;format period yymmd.;&lt;/STRONG&gt;&lt;BR /&gt;datalines;&lt;BR /&gt;9/1/2013 03387G C0 4941&lt;BR /&gt;9/1/2013 03387G C1 5113&lt;BR /&gt;9/1/2013 03387G G1 644&lt;BR /&gt;9/1/2013 03387G G2 3097&lt;BR /&gt;9/1/2013 03387G R0 233&lt;BR /&gt;9/1/2013 03387G R1 186&lt;BR /&gt;9/1/2013 03390K C0 10&lt;BR /&gt;9/1/2013 03390K C1 18&lt;BR /&gt;9/1/2013 03390K G1 1&lt;BR /&gt;9/1/2013 03390K G2 62&lt;BR /&gt;9/1/2013 03391L C1 3&lt;BR /&gt;9/1/2013 03391L G2 4&lt;BR /&gt;9/1/2013 03393N C0 8&lt;BR /&gt;9/1/2013 03393N C1 296&lt;BR /&gt;9/1/2013 03393N C1 5&lt;BR /&gt;9/1/2013 03393N G1 1&lt;BR /&gt;9/1/2013 03393N G2 555&lt;BR /&gt;9/1/2013 03393N R0 1&lt;BR /&gt;9/1/2013 03393N R1 1&lt;BR /&gt;10/1/2013 03387G C0 112&lt;BR /&gt;10/1/2013 03387G C1 4&lt;BR /&gt;10/1/2013 03387G G1 7&lt;BR /&gt;10/1/2013 03387G G2 3000&lt;BR /&gt;10/1/2013 03387G R0 23&lt;BR /&gt;10/1/2013 03387G R1 0&lt;BR /&gt;10/1/2013 03390K C0 325556&lt;BR /&gt;10/1/2013 03390K C1 6&lt;BR /&gt;10/1/2013 03390K G1 3&lt;BR /&gt;10/1/2013 03390K G2 2&lt;BR /&gt;10/1/2013 03391L C1 44566&lt;BR /&gt;10/1/2013 03391L G2 323&lt;BR /&gt;10/1/2013 03393N C0 21&lt;BR /&gt;10/1/2013 03393N C1 1&lt;BR /&gt;10/1/2013 03393N C1 1&lt;BR /&gt;10/1/2013 03393N G1 9&lt;BR /&gt;10/1/2013 03393N G2 9&lt;BR /&gt;10/1/2013 03393N R0 7&lt;BR /&gt;10/1/2013 03393N R1 4&lt;BR /&gt;;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2017 01:17:35 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2017-08-04T01:17:35Z</dc:date>
    <item>
      <title>error in converting text date column d/mm/yyyy to SAS date column YYYYMMM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385539#M92236</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Can anyone please help - I want to convert a text data column that has 1/mm/yyyy to a sas date column that has only yyyymmm, for example 1/09/2013 to 2013M09 (please see files attached)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; homebase &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'C:\Homebase'&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 color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=homebase.dummy1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&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; homebase.dummy2;&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; homebase.dummy1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;sample_date = input(period,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yymmdd10.&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; sample_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yymm10.&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;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=homebase.dummy2;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 01:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385539#M92236</guid>
      <dc:creator>Phil_from_PGA</dc:creator>
      <dc:date>2017-08-04T01:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: error in converting text date column d/mm/yyyy to SAS date column YYYYMMM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385540#M92237</link>
      <description>&lt;P&gt;data have;&lt;BR /&gt;input period : ddmmyy10. (item_code patient_cat prescriptions) ($);&lt;BR /&gt;&lt;STRONG&gt;format period yymmd.;&lt;/STRONG&gt;&lt;BR /&gt;datalines;&lt;BR /&gt;9/1/2013 03387G C0 4941&lt;BR /&gt;9/1/2013 03387G C1 5113&lt;BR /&gt;9/1/2013 03387G G1 644&lt;BR /&gt;9/1/2013 03387G G2 3097&lt;BR /&gt;9/1/2013 03387G R0 233&lt;BR /&gt;9/1/2013 03387G R1 186&lt;BR /&gt;9/1/2013 03390K C0 10&lt;BR /&gt;9/1/2013 03390K C1 18&lt;BR /&gt;9/1/2013 03390K G1 1&lt;BR /&gt;9/1/2013 03390K G2 62&lt;BR /&gt;9/1/2013 03391L C1 3&lt;BR /&gt;9/1/2013 03391L G2 4&lt;BR /&gt;9/1/2013 03393N C0 8&lt;BR /&gt;9/1/2013 03393N C1 296&lt;BR /&gt;9/1/2013 03393N C1 5&lt;BR /&gt;9/1/2013 03393N G1 1&lt;BR /&gt;9/1/2013 03393N G2 555&lt;BR /&gt;9/1/2013 03393N R0 1&lt;BR /&gt;9/1/2013 03393N R1 1&lt;BR /&gt;10/1/2013 03387G C0 112&lt;BR /&gt;10/1/2013 03387G C1 4&lt;BR /&gt;10/1/2013 03387G G1 7&lt;BR /&gt;10/1/2013 03387G G2 3000&lt;BR /&gt;10/1/2013 03387G R0 23&lt;BR /&gt;10/1/2013 03387G R1 0&lt;BR /&gt;10/1/2013 03390K C0 325556&lt;BR /&gt;10/1/2013 03390K C1 6&lt;BR /&gt;10/1/2013 03390K G1 3&lt;BR /&gt;10/1/2013 03390K G2 2&lt;BR /&gt;10/1/2013 03391L C1 44566&lt;BR /&gt;10/1/2013 03391L G2 323&lt;BR /&gt;10/1/2013 03393N C0 21&lt;BR /&gt;10/1/2013 03393N C1 1&lt;BR /&gt;10/1/2013 03393N C1 1&lt;BR /&gt;10/1/2013 03393N G1 9&lt;BR /&gt;10/1/2013 03393N G2 9&lt;BR /&gt;10/1/2013 03393N R0 7&lt;BR /&gt;10/1/2013 03393N R1 4&lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 01:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385540#M92237</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-08-04T01:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: error in converting text date column d/mm/yyyy to SAS date column YYYYMMM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385547#M92241</link>
      <description>&lt;P&gt;Many thanks, this works, now my problem is that I want to sum the number of prescriptions in each month by item_code&lt;/P&gt;&lt;P&gt;That is, there should be a final table that has&amp;nbsp;columns&amp;nbsp;period, item_code and prescriptions.&lt;/P&gt;&lt;P&gt;There should be&amp;nbsp;rows of which the first rown is the column&amp;nbsp;name, the second should be 01SEP2013 and the third should be 01OCT2013.&lt;/P&gt;&lt;P&gt;The observations in the cells should be the sum of prescriptions in each month by (unique) item_code&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;item_code&lt;/TD&gt;&lt;TD&gt;sum of prescriptions&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Sep-13&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Oct-13&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&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;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; homebase.dummy3 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; item_code, sum(prescriptions) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; prescriptions_sum&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; homebase.dummy2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;group&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; item_code, period; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&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;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=homebase.dummy3;&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;</description>
      <pubDate>Fri, 04 Aug 2017 02:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385547#M92241</guid>
      <dc:creator>Phil_from_PGA</dc:creator>
      <dc:date>2017-08-04T02:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: error in converting text date column d/mm/yyyy to SAS date column YYYYMMM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385602#M92263</link>
      <description>&lt;P&gt;Please don't mark one question as correct, then ask another question. &amp;nbsp;Correct answered questions generally don't get looked at again, and it can be confusing trying to find information through multiple posts. &amp;nbsp;Once you are happy a question is answered, then mark it as correct, and then if you have further questions, start a new post. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, when posting questions, follow the guidance below the Post buttong when submitting new questions:&lt;/P&gt;
&lt;P&gt;Post test data in the form of a datastep, using the code window which is the {i} above the post. &amp;nbsp;This keeps formatting and shows structure and data in a usable form. &amp;nbsp;Office files are dangerous.&lt;/P&gt;
&lt;P&gt;Its also a good idea to show example output required, and what problems you get in logs etc. if there are any.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 08:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-in-converting-text-date-column-d-mm-yyyy-to-SAS-date/m-p/385602#M92263</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-04T08:37:20Z</dc:date>
    </item>
  </channel>
</rss>

