<?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 numeric columns to date in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644943#M35962</link>
    <description>&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; date = mdy(month,1,year);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; format date yymmd7.;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any SAS date must have a day of the month associated. SAS will use the first of the month as the day for the year and month only informats. So this would be consistent.&lt;/P&gt;</description>
    <pubDate>Mon, 04 May 2020 09:17:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-05-04T09:17:25Z</dc:date>
    <item>
      <title>Convert numeric columns to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644935#M35957</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;my dataset contains 2 numeric columns YEAR and MONTH. Example:&lt;/P&gt;&lt;P&gt;YEAR MONTH&lt;/P&gt;&lt;P&gt;2017&amp;nbsp; &amp;nbsp;6&lt;/P&gt;&lt;P&gt;2018&amp;nbsp; &amp;nbsp;8&lt;/P&gt;&lt;P&gt;2017&amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;2019&amp;nbsp; &amp;nbsp;11&lt;/P&gt;&lt;P&gt;I want to see a date of them (in &lt;SPAN&gt;SAS date format)&lt;/SPAN&gt;. It should looks like:&lt;/P&gt;&lt;P&gt;DATE&lt;/P&gt;&lt;P&gt;2017-06&lt;/P&gt;&lt;P&gt;2018-08&lt;/P&gt;&lt;P&gt;2017-05&lt;/P&gt;&lt;P&gt;2019-11&lt;/P&gt;&lt;P&gt;Have you any idea how to achieve that?&lt;/P&gt;&lt;P&gt;Have a nice day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 09:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644935#M35957</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2020-05-04T09:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric columns to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644937#M35958</link>
      <description>&lt;P&gt;Do you want DATE to be a character or SAS Date variable?&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 09:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644937#M35958</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-05-04T09:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric columns to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644938#M35959</link>
      <description>Date should be SAS date variable</description>
      <pubDate>Mon, 04 May 2020 09:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644938#M35959</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2020-05-04T09:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric columns to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644940#M35960</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/315439"&gt;@PatrykSAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-&amp;gt; the MDY() function&amp;nbsp;&lt;SPAN&gt;returns a SAS date value from month, day, and year values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;-&amp;gt; DATE will be a valid SAS date, with a format to have the desired display&lt;/P&gt;
&lt;P&gt;-&amp;gt; Here, the first of each month have been imputed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input YEAR MONTH;
	datalines;
2017   6
2018   8
2017   5
2019   11
;
run;

data want;
	set have;
	format DATE yymmd7.;
	DATE = mdy(MONTH,1,YEAR);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 09:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644940#M35960</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-05-04T09:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric columns to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644941#M35961</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;data have;
input YEAR MONTH;
datalines;
2017 6
2018 8
2017 5
2019 11
;

data want;
    set have;
    date=mdy(month, 1, year);
    format date yymmd7.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 May 2020 09:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644941#M35961</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-05-04T09:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric columns to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644943#M35962</link>
      <description>&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; date = mdy(month,1,year);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; format date yymmd7.;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any SAS date must have a day of the month associated. SAS will use the first of the month as the day for the year and month only informats. So this would be consistent.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 09:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644943#M35962</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-04T09:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric columns to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644944#M35963</link>
      <description>It works great, thank you all</description>
      <pubDate>Mon, 04 May 2020 09:21:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644944#M35963</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2020-05-04T09:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert numeric columns to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644963#M35966</link>
      <description>&lt;P&gt;&lt;EM&gt;"Any SAS date must have a day of the month associated. SAS will use the first of the month as the day for the year and month only informats. So this would be consistent."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good morning and Thank you Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; for that. Those are valuable information/notes I am looking from veterans like you. Well, I often take notes in many of the threads you participate since the time you once taught me time series shifting intervals like fiscal- years/quarters. In essence, what I need is the &lt;EM&gt;&lt;STRONG&gt;mechanics of how stuff works&lt;/STRONG&gt;&lt;/EM&gt;, I shall do the coding myself. Thank you once again for all the notes that are priceless.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 12:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-numeric-columns-to-date/m-p/644963#M35966</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-04T12:08:39Z</dc:date>
    </item>
  </channel>
</rss>

