<?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: All month in a year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314869#M68634</link>
    <description>&lt;P&gt;Yes they are stored in the dataset already. &amp;nbsp; is it possible to just show the month in the year 2008 instead of just printing the date and month together?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 16:14:06 GMT</pubDate>
    <dc:creator>Boa</dc:creator>
    <dc:date>2016-11-28T16:14:06Z</dc:date>
    <item>
      <title>All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314858#M68631</link>
      <description>&lt;P&gt;Hi sasusers, i have a dataset of 300000 + datas and with orderdate as my only column and it contains Datetime as well.&lt;/P&gt;&lt;P&gt;How can i show all the month in a 2008? For example, Jan , Feb , Mar without the days value. I am doing this for a bar chart wizard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some data in my orderdate:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Orderdate&lt;/P&gt;&lt;P&gt;13OCT07 &amp;nbsp;00:00:00&lt;/P&gt;&lt;P&gt;2JUN08 &amp;nbsp; &amp;nbsp;00:00:00&lt;/P&gt;&lt;P&gt;2JAN08 &amp;nbsp; &amp;nbsp;00:00:00&lt;/P&gt;&lt;P&gt;1JAN08 &amp;nbsp; &amp;nbsp;00:00:00&lt;/P&gt;&lt;P&gt;1DEC08 &amp;nbsp; &amp;nbsp;00:00:00&lt;/P&gt;&lt;P&gt;5DEC09 &amp;nbsp; &amp;nbsp;00:00:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 14:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314858#M68631</guid>
      <dc:creator>Boa</dc:creator>
      <dc:date>2016-11-29T14:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314859#M68632</link>
      <description>&lt;P&gt;are your date/datetime variables stored as you have posted? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314859#M68632</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-28T16:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314862#M68633</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have (where=(year(datepart(orderdate))=2008));
  mnth=month(datepart(orderdate));
run;&lt;/PRE&gt;
&lt;P&gt;This now only contains 2008 data, and has a variable mnth which contains the 2 digit month (which you can format to other text if you want, look up MONNAME. format).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314862#M68633</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-28T16:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314869#M68634</link>
      <description>&lt;P&gt;Yes they are stored in the dataset already. &amp;nbsp; is it possible to just show the month in the year 2008 instead of just printing the date and month together?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314869#M68634</guid>
      <dc:creator>Boa</dc:creator>
      <dc:date>2016-11-28T16:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314872#M68635</link>
      <description>&lt;P&gt;Displaying values is often best accomplished with a Format. SAS provides tools to create custom formats for date, time and datetime values that you can customize.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
  picture dtmon (default=3)
  . = " "
  low - high = '%b'   (datatype=datetime)
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use the dtmon format in any procedure you want to display the 3-letter month abbreviation. This example will print the first 10 observations using the format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=work.date (obs=10);
   var orderdate;
   format orderdate dtmon.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:14:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314872#M68635</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-28T16:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314878#M68636</link>
      <description>&lt;P&gt;Firstly, thanks for the code. I tried and used it for my program, the code looks fine but there is no output in the orderdate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would like to ask why would you put a bracket behing a where clause? if you put that, the where clause wont run and it shows error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what is mnth? am i creating a new variable just for month itself? Kindly advise. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314878#M68636</guid>
      <dc:creator>Boa</dc:creator>
      <dc:date>2016-11-28T16:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314886#M68638</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, you should post some test data - in the form of a datastep - so I can run it and see. &amp;nbsp;I cant tell offhand what is happening without code/log/test data. &amp;nbsp;Follow this post (only need a few rows):&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The where clause is correct, it is an option on the input dataset, so the where is applied as the data is read. &amp;nbsp;You can put dataset options in several places:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://onlinecourses.science.psu.edu/stat481/node/16" target="_blank"&gt;https://onlinecourses.science.psu.edu/stat481/node/16&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your getting an error, then its likely to be a typo or something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;data have;
  orderdate="13OCT2007:00:00:00"dt; output;
  orderdate="02JUN2008:00:00:00"dt; output;
  orderdate="02JAN2008:00:00:00"dt; output;
  format orderdate datetime.;
run;

data want;
  set have (where=(year(datepart(orderdate))=2008));
  mnth=month(datepart(orderdate));
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mnth is a new variable, it is numeric, and contains the month number within the year, i.e. Jan=1. &amp;nbsp;You can then format this number using monname to display as Jan.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314886#M68638</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-28T16:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314890#M68639</link>
      <description>&lt;P&gt;ok thanks., i have another question that is similar to this, i probably would post another question. But i doubt it would use monname3.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 17:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314890#M68639</guid>
      <dc:creator>Boa</dc:creator>
      <dc:date>2016-11-28T17:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: All month in a year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314905#M68644</link>
      <description>it is about the bar-chart wizard (not the data).&lt;BR /&gt;In SAS/Graph, there is an approach which solves this problem by defining all the "mid-points" you want</description>
      <pubDate>Mon, 28 Nov 2016 17:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-month-in-a-year/m-p/314905#M68644</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2016-11-28T17:46:29Z</dc:date>
    </item>
  </channel>
</rss>

