<?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: convert date time and date to mmm yyyy in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702392#M2627</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;convert these to mmm yyyy (not just format)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;You mean you want a string as output?&lt;/P&gt;
&lt;P&gt;Why not a date that you can format as you will?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;These two variables have entries for every day of the week.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;How will you keep the weekly detail if you just keep monyy?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2020 04:40:18 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-11-30T04:40:18Z</dc:date>
    <item>
      <title>convert date time and date to mmm yyyy</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702389#M2626</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two datasets that I'm using in SAS VA and also in excel and powerbi. My boss wants reports in all 3 products.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset 1 has&amp;nbsp; variable called "StartDate" and this is in DATETIME18. format. (From an external organistaion)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset 2 has a variable called "Date" and this is&amp;nbsp;DATE9. format. (From a SharePoint List)&lt;/P&gt;&lt;P&gt;These two variables have entries for every day of the week.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I merge these two dataset, however I'd like to create a common variable&amp;nbsp; from the above and convert these to mmm yyyy (not just format). Is there a way to do this&amp;gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 04:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702389#M2626</guid>
      <dc:creator>Haydn</dc:creator>
      <dc:date>2020-11-30T04:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: convert date time and date to mmm yyyy</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702392#M2627</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;convert these to mmm yyyy (not just format)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;You mean you want a string as output?&lt;/P&gt;
&lt;P&gt;Why not a date that you can format as you will?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;These two variables have entries for every day of the week.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;How will you keep the weekly detail if you just keep monyy?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 04:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702392#M2627</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-30T04:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: convert date time and date to mmm yyyy</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702394#M2628</link>
      <description>How will you keep the weekly detail if you just keep monyy? (I'll still have the original variables to report at that level)&lt;BR /&gt;Why not a date that you can format as you will? (I'm finding that different products treat the formats differently) As an example I used the following. ReportingMonth= input(symget(StartDate),date9.);&lt;BR /&gt;format ReportingMonth monyy7.;&lt;BR /&gt;This works fine in SAS EG, but when used in PowerBI, it converts it back to dd/mm/yyy.</description>
      <pubDate>Mon, 30 Nov 2020 04:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702394#M2628</guid>
      <dc:creator>Haydn</dc:creator>
      <dc:date>2020-11-30T04:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: convert date time and date to mmm yyyy</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702402#M2629</link>
      <description>&lt;P&gt;This works:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DATESTR = put(DATETIME,dtmonyy.);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Just make it a habit to browse the &lt;A href="https://documentation.sas.com/?cdcId=vdmmlcdc&amp;amp;cdcVersion=8.1&amp;amp;docsetId=ds2pg&amp;amp;docsetTarget=p0bz5detpfj01qn1kz2in7xymkdl.htm&amp;amp;locale=en" target="_self"&gt;list of formats&lt;/A&gt; to find what you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 05:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702402#M2629</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-30T05:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: convert date time and date to mmm yyyy</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702404#M2630</link>
      <description>&lt;P&gt;How are you getting your SAS dataset into PowerBI then? For reporting to work correctly in all products your date variables will have to be defined as 'proper dates', not dates stored as text strings. For Excel that means a numeric containing the number of days from 1 Jan 1900, for SAS the number of days from 1 Jan 1960 and for PowerBI it will need to be a PowerBI date (not sure how these are stored internally).&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 05:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702404#M2630</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-30T05:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: convert date time and date to mmm yyyy</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702432#M2631</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/41546"&gt;@Haydn&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;This works fine in SAS EG, but when used in PowerBI, it converts it back to dd/mm/yyy.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then apply the proper format in Power BI. Storing dates as strings is, to be polite, not a bright thing to do in any environment.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 09:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702432#M2631</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-30T09:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: convert date time and date to mmm yyyy</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702632#M2632</link>
      <description>To be clear, I DO NOT want to store these as strings.&lt;BR /&gt;I wanted to create variable that where 01/07/2020 is for the Date variable, another variable is created, called ReportingMonth and this has the value of July2020, as date. I am aware I can then format as these in other products like SAS VA, Excel etc. But I was hoping avoid any sort of additional work on (such as formating etc) in other products. Especially given I have to create the same report in 3 different products. While not time consuming for one report, it does add up over time. But I guess this is not possible.</description>
      <pubDate>Mon, 30 Nov 2020 20:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702632#M2632</guid>
      <dc:creator>Haydn</dc:creator>
      <dc:date>2020-11-30T20:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: convert date time and date to mmm yyyy</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702641#M2633</link>
      <description>&lt;P&gt;Do you want get a single date value for every possible day within the same month?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;month=intnx('month',date,0);
format month monyy7.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you prefer it as a string you can skip the extra variable and just store the formatted value as the formatted value is the same no matter what day of the moth the DATE value actually has.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;month=put(date,monyy7.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have some values that start as datetime then you will need to convert those to dates for the first method:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;month=intnx('month',datepart(datetime),0);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or use a datetime format for the second method.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;month=put(datetime,dtmonyy7.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Nov 2020 21:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/convert-date-time-and-date-to-mmm-yyyy/m-p/702641#M2633</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-30T21:06:36Z</dc:date>
    </item>
  </channel>
</rss>

