<?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 Alternatives to get (Month Year Name together) from Numeric values? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173916#M33384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, All,&lt;/P&gt;&lt;P&gt;I ran into a small problem which I need to get the month name spelled out together with the year, from a numeric date value. I can do it using catx function after obtaining the month name in two ways. However, I wonder if there are any better ways to do this, such as using only one function to get the result (e.g. January 2006). Please offer thoughts. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/**/&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;length want1 want2 $25.;&lt;/P&gt;&lt;P&gt;input yearmonth;&lt;/P&gt;&lt;P&gt;yearmonth_d=input (put(yearmonth,6.), yymmn6.);&lt;/P&gt;&lt;P&gt;/*format yearmonth_d yymmd.;*/&lt;/P&gt;&lt;P&gt;format yearmonth_d monyy7.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year =year(yearmonth_d);&lt;/P&gt;&lt;P&gt;month1=put(yearmonth_d,monname.); * 1st way to get the month;&lt;/P&gt;&lt;P&gt;want1=catx (' ', month1,year);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;month2=put(yearmonth_d,worddate9.); * 2nd way to get the month;&lt;/P&gt;&lt;P&gt;want2=catx (' ', month2,year);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;200601&lt;/P&gt;&lt;P&gt;200709&lt;/P&gt;&lt;P&gt;200812&lt;/P&gt;&lt;P&gt;;run;&lt;/P&gt;&lt;P&gt;/**/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jan 2015 22:27:06 GMT</pubDate>
    <dc:creator>jiangmi</dc:creator>
    <dc:date>2015-01-07T22:27:06Z</dc:date>
    <item>
      <title>Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173916#M33384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, All,&lt;/P&gt;&lt;P&gt;I ran into a small problem which I need to get the month name spelled out together with the year, from a numeric date value. I can do it using catx function after obtaining the month name in two ways. However, I wonder if there are any better ways to do this, such as using only one function to get the result (e.g. January 2006). Please offer thoughts. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/**/&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;length want1 want2 $25.;&lt;/P&gt;&lt;P&gt;input yearmonth;&lt;/P&gt;&lt;P&gt;yearmonth_d=input (put(yearmonth,6.), yymmn6.);&lt;/P&gt;&lt;P&gt;/*format yearmonth_d yymmd.;*/&lt;/P&gt;&lt;P&gt;format yearmonth_d monyy7.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year =year(yearmonth_d);&lt;/P&gt;&lt;P&gt;month1=put(yearmonth_d,monname.); * 1st way to get the month;&lt;/P&gt;&lt;P&gt;want1=catx (' ', month1,year);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;month2=put(yearmonth_d,worddate9.); * 2nd way to get the month;&lt;/P&gt;&lt;P&gt;want2=catx (' ', month2,year);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;200601&lt;/P&gt;&lt;P&gt;200709&lt;/P&gt;&lt;P&gt;200812&lt;/P&gt;&lt;P&gt;;run;&lt;/P&gt;&lt;P&gt;/**/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 22:27:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173916#M33384</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-01-07T22:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173917#M33385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been digging through the documentation and cannot find what you are looking for which is really surprising because I thought one of the formats would surely give you just the month without an abreviation and the year. The best I could find is the WORDDATEw. format if you are okay with including the day: January 7, 2015.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am curious if others are aware of any functions that return the date in the format you are requesting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Times New Roman;"&gt;&lt;BR /&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 22:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173917#M33385</guid>
      <dc:creator>MaikH_Schutze</dc:creator>
      <dc:date>2015-01-07T22:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173918#M33386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, M. I am aware of this &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;WORDDATEw. format. I really don't need the day information. But that is a good option. Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 22:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173918#M33386</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-01-07T22:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173919#M33387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could always parse what you want using the worddate format. e.g.,:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length want3 $25.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input yearmonth yymmn6.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; want3=substr(put(yearmonth,worddatx.),anyalpha(put(yearmonth,worddatx.)));&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;200601&lt;/P&gt;&lt;P&gt;200709&lt;/P&gt;&lt;P&gt;200812&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 23:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173919#M33387</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-01-07T23:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173920#M33388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always define your own picture format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; picture yearmonth (default=30) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; other='%C %Y' (datatype=date ) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do yearmonth=200601,200709,200812;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; want=compbl(put(input(put(yearmonth,6.),yymmn6.),yearmonth.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 03:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173920#M33388</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-01-08T03:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173921#M33389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always customize the date or datetime format via proc format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
proc format;
picture fmt
 low-high='%B %Y'(datatype=date) ;
run;
data have;
input yearmonth;
yearmonth_d=input(put(yearmonth,6.), yymmn6.);
format yearmonth_d fmt20.;
cards;
200601
200709
200812
;run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 04:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173921#M33389</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-08T04:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173922#M33390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What does '%B %Y' indicates in your format?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 13:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173922#M33390</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-01-08T13:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173923#M33391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same question for Patrick and Xia. Can you please explain the processing of PROC format used in both of your examples?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, it still appears that both examples still use standard SAS formats to pull (or parse) out the pieces and then join them together in a new format. Isn't that the same as parsing the values and then concatenating them to get the desired result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 14:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173923#M33391</guid>
      <dc:creator>MaikH_Schutze</dc:creator>
      <dc:date>2015-01-08T14:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173924#M33392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can find them at sas documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%B&lt;/P&gt;&lt;P&gt;full month name, for example, January.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Y&lt;/P&gt;&lt;P&gt;year with century as a four-digit decimal number (1970–2069), for example,&lt;/P&gt;&lt;P&gt;1994.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 14:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173924#M33392</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-08T14:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173925#M33393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Isn't that the same as parsing the values and then concatenating them to get the desired result?"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;No. They are different . Patrick and I make a whole new format and transform it into character via put() or just assign it to the variable. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;They are two different skill. Patrick's and mine would be better(i.e. no need to add SUBSTRING function )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 14:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173925#M33393</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-08T14:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173926#M33394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following SUGI doc not only explains the %B, it give a full table of Directives in Figure 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi27/p101-27.pdf" title="http://www2.sas.com/proceedings/sugi27/p101-27.pdf"&gt;http://www2.sas.com/proceedings/sugi27/p101-27.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should help build a format for almost any date in almost any format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wayne Bell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 14:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173926#M33394</guid>
      <dc:creator>WayneBell</dc:creator>
      <dc:date>2015-01-08T14:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173927#M33395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wayne: a more up to date list can be found at: &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473467.htm#a000530223" title="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473467.htm#a000530223"&gt;Base SAS(R) 9.2 Procedures Guide&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 15:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173927#M33395</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-01-08T15:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Alternatives to get (Month Year Name together) from Numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173928#M33396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all.&lt;/P&gt;&lt;P&gt;I think i got some study to do next.&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 17:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Alternatives-to-get-Month-Year-Name-together-from-Numeric-values/m-p/173928#M33396</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-01-08T17:02:19Z</dc:date>
    </item>
  </channel>
</rss>

