<?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: Need count by monthyear in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751499#M236580</link>
    <description>&lt;P&gt;Another solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
     tables date;
     format date yymmn6.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Jul 2021 16:39:05 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-07-01T16:39:05Z</dc:date>
    <item>
      <title>Need count by monthyear</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751494#M236576</link>
      <description>&lt;P&gt;iam getting error from below query&lt;/P&gt;&lt;P&gt;date format yymmdd10.(12/30/2020) in the table.&lt;/P&gt;&lt;P&gt;any help appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select put(date,yymmn6.)as monyr,count(*) from table&lt;BR /&gt;group by monyr&lt;BR /&gt;order by monyr desc;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 16:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751494#M236576</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2021-07-01T16:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need count by monthyear</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751495#M236577</link>
      <description>&lt;P&gt;need volumes/counts by month for 3 years&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 16:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751495#M236577</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2021-07-01T16:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need count by monthyear</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751497#M236579</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select put(date,yymmn6.)as monyr,count(*) from table&amp;nbsp;group by calculated monyr
order by calculated monyr desc;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the future, when you get an error message, then 100% of the time (no exceptions, and don't wait until we ask) you need to show us the LOG for this PROC, the entire log for this PROC, all of it, every single character of the log for this PROC, do not select and choose parts of the log for this PROC. That way we can see the code, the ERROR message(s), the WARNING message(s) and the NOTE message(s). Copy the LOG as text and paste it into the box that appears when you click on the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if my correction to your code above doesn't fix the problem, then show us the log exactly as I have explained.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 16:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751497#M236579</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-01T16:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need count by monthyear</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751499#M236580</link>
      <description>&lt;P&gt;Another solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
     tables date;
     format date yymmn6.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jul 2021 16:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751499#M236580</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-01T16:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need count by monthyear</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751500#M236581</link>
      <description>&lt;P&gt;ERROR: Teradata prepare: Syntax error: Data Type "date" does not match a Defined Type name. SQL statement was: select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Put(date,yymmn6.)as monyr,count(*) from table group by calculated monyr order by calculated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monyr desc;.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 16:47:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751500#M236581</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2021-07-01T16:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need count by monthyear</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751502#M236583</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/354671"&gt;@Cho8&lt;/a&gt;&amp;nbsp; we are trying to help you, but you have to help us&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Repeating:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;you need to show us the LOG for this PROC, the entire log for this PROC, all of it, every single character of the log for this PROC, do not select and choose parts of the log for this PROC. That way we can see the code, the ERROR message(s), the WARNING message(s) and the NOTE message(s). Copy the LOG as text and paste it into the box that appears when you click on the &amp;lt;/&amp;gt; icon.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 16:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751502#M236583</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-01T16:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need count by monthyear</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751506#M236584</link>
      <description>&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to XXX(database=XXXX tdpid=XXXX user=XXX password=”XXXX");&lt;/P&gt;&lt;P&gt;28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table XXX as&lt;/P&gt;&lt;P&gt;29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from connection to XX&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select put(date,yymmn6.)as monyr,count(*) from XXXXXXXXX&lt;/P&gt;&lt;P&gt;32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by calculated monyr&lt;/P&gt;&lt;P&gt;34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by calculated monyr desc;&lt;/P&gt;&lt;P&gt;35&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;36&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;ERROR: Teradata prepare: Syntax error: Data Type "date" does not match a Defined Type name. SQL statement was: select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Put(date,yymmn6.)as monyr,count(*) from XXX.table_name group by calculated monyr order by calculated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monyr desc;.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 17:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751506#M236584</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2021-07-01T17:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need count by monthyear</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751509#M236585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/354671"&gt;@Cho8&lt;/a&gt;&amp;nbsp; The code block of yours -&lt;/P&gt;
&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;
&lt;P&gt;31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select put(date,yymmn6.)as monyr,count(*) from XXXXXXXXX&lt;/P&gt;
&lt;P&gt;32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by calculated monyr&lt;/P&gt;
&lt;P&gt;34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by calculated monyr desc;&lt;/P&gt;
&lt;P&gt;35&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;36&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is actually for writing DBMS specific SQL aka pass through for open database connectivity or in simple terms is a SAS Access to database tables. However, in your case it is apparent you have written Proc SQL which is SAS's proprietary SQL. Therefore, the error is rather obvious.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Option 1: Write DBMS specific query i.e. Teradata SQL&lt;/P&gt;
&lt;P&gt;Option 2: Extract using DBMS specific SQL in code block and then write another step using Proc SQL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH &amp;amp; Kind Regards!&lt;/P&gt;
&lt;P&gt;NS&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 17:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-count-by-monthyear/m-p/751509#M236585</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-07-01T17:24:51Z</dc:date>
    </item>
  </channel>
</rss>

