<?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: How to combine three columns to one date variable and keep all my observations? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-combine-three-columns-to-one-date-variable-and-keep-all/m-p/900180#M83050</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
set oldDataSet;

newDate = mdy(month, day, year);
format newDate ddmmyy8.;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Assuming you already have a data set with the day, month, year referencing it with a SET statement instead is what you want to do.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/459631"&gt;@kimmialex&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I used this code, but I have over 8,000 observations. When I use this code, I only see my first three observations. I am sure there is an easier code without putting each dataline in. Thanks for the help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data deaths;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input year day month;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;format new ddmmyy8.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;new=mdy(month,day,year);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1999 1 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1999 1 2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;1999 1 3&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 17:10:51 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2023-10-26T17:10:51Z</dc:date>
    <item>
      <title>How to combine three columns to one date variable and keep all my observations?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-combine-three-columns-to-one-date-variable-and-keep-all/m-p/900176#M83048</link>
      <description>&lt;P&gt;I used this code, but I have over 8,000 observations. When I use this code, I only see my first three observations. I am sure there is an easier code without putting each dataline in. Thanks for the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data deaths;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input year day month;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;format new ddmmyy8.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;new=mdy(month,day,year);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1999 1 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1999 1 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1999 1 3&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 17:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-combine-three-columns-to-one-date-variable-and-keep-all/m-p/900176#M83048</guid>
      <dc:creator>kimmialex</dc:creator>
      <dc:date>2023-10-26T17:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three columns to one date variable and keep all my observations?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-combine-three-columns-to-one-date-variable-and-keep-all/m-p/900179#M83049</link>
      <description>&lt;P&gt;I don't see anything combining "three columns" so it appears that you have skipped a bunch of step, like how you combined, what on, what your start looks like and what you expect the result to look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean "create a date variable" from month, day and year variable you have the right function (likely) but you don't show the use of any existing data set which would go on a set statement such as:&lt;/P&gt;
&lt;PRE&gt;data newdataset;
   set existingdatasetname;
   format new ddmmyy8.;
   /* assuming the data set on the SET statement 
     has numeric variables named month, day and year
     and year is 4 digits*/
   new=mdy(month,day,year);
run;&lt;/PRE&gt;
&lt;P&gt;If "deaths" was the name of your data set you have replaced it and need to re-create it.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 17:09:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-combine-three-columns-to-one-date-variable-and-keep-all/m-p/900179#M83049</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-10-26T17:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three columns to one date variable and keep all my observations?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-combine-three-columns-to-one-date-variable-and-keep-all/m-p/900180#M83050</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
set oldDataSet;

newDate = mdy(month, day, year);
format newDate ddmmyy8.;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Assuming you already have a data set with the day, month, year referencing it with a SET statement instead is what you want to do.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/459631"&gt;@kimmialex&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I used this code, but I have over 8,000 observations. When I use this code, I only see my first three observations. I am sure there is an easier code without putting each dataline in. Thanks for the help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data deaths;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input year day month;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;format new ddmmyy8.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;new=mdy(month,day,year);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1999 1 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1999 1 2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;1999 1 3&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 17:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-combine-three-columns-to-one-date-variable-and-keep-all/m-p/900180#M83050</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-10-26T17:10:51Z</dc:date>
    </item>
  </channel>
</rss>

