<?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 Convert year and month columns to a date in one column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794154#M254614</link>
    <description>&lt;P&gt;Here is what I have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input year month;&lt;BR /&gt;infile datalines missover;&lt;BR /&gt;datalines;&lt;BR /&gt;2020 1&lt;BR /&gt;2020 2&lt;BR /&gt;2020 3&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keen to want below:&lt;/P&gt;
&lt;P&gt;31Jan2020&lt;/P&gt;
&lt;P&gt;29Feb2020&lt;/P&gt;
&lt;P&gt;31Mar2020&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 02:38:01 GMT</pubDate>
    <dc:creator>ywon111</dc:creator>
    <dc:date>2022-02-03T02:38:01Z</dc:date>
    <item>
      <title>Convert year and month columns to a date in one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794154#M254614</link>
      <description>&lt;P&gt;Here is what I have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input year month;&lt;BR /&gt;infile datalines missover;&lt;BR /&gt;datalines;&lt;BR /&gt;2020 1&lt;BR /&gt;2020 2&lt;BR /&gt;2020 3&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keen to want below:&lt;/P&gt;
&lt;P&gt;31Jan2020&lt;/P&gt;
&lt;P&gt;29Feb2020&lt;/P&gt;
&lt;P&gt;31Mar2020&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 02:38:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794154#M254614</guid>
      <dc:creator>ywon111</dc:creator>
      <dc:date>2022-02-03T02:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert year and month columns to a date in one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794155#M254615</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
date = mdy(month, 1, year);
date_month_end = intnx('month', date, 0, 'e');
format date: date9.;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/323303"&gt;@ywon111&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here is what I have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input year month;&lt;BR /&gt;infile datalines missover;&lt;BR /&gt;datalines;&lt;BR /&gt;2020 1&lt;BR /&gt;2020 2&lt;BR /&gt;2020 3&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keen to want below:&lt;/P&gt;
&lt;P&gt;31Jan2020&lt;/P&gt;
&lt;P&gt;29Feb2020&lt;/P&gt;
&lt;P&gt;31Mar2020&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 02:46:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794155#M254615</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-03T02:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert year and month columns to a date in one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794156#M254616</link>
      <description>&lt;P&gt;how about this&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  dmy=intnx ('month',mdy(month,1,year),0,'E');
  format dmy date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Feb 2022 02:46:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794156#M254616</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-02-03T02:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert year and month columns to a date in one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794157#M254617</link>
      <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;data have;
input year month;
infile datalines missover;
dateval = intnx('month',mdy(month,1,year),0,'E');
format dateval date9.;
datalines;
2020 1
2020 2
2020 3
;&lt;/PRE&gt;
&lt;P&gt;The MDY function uses month, day and year values to create a date, in this case using 1 for day as every month has a day 1.&amp;nbsp; The INTNX function then adjusts that date to the end of that current month, 'month' being the interval, 0 being the current month to adjust the date value and 'E' to set the end of the interval.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 02:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-year-and-month-columns-to-a-date-in-one-column/m-p/794157#M254617</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-03T02:46:54Z</dc:date>
    </item>
  </channel>
</rss>

