<?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: Concatenating Dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737727#M230004</link>
    <description>&lt;P&gt;CATX uses the underlying data, so nest it with a PUT statement to have the format honoured.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0p7wxtk0hvn83n1pveisbcp2ae9.htm" target="_self"&gt;documentation&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;H4 class="xisDoc-argument"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;item&lt;/EM&gt;&lt;/H4&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;specifies a constant, variable, or expression, either character or numeric. &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;If&amp;nbsp;&lt;EM class="xisDoc-userSuppliedValue"&gt;item&lt;/EM&gt;&amp;nbsp;is numeric, its value is converted to a character string by using the BEST&lt;EM class="xisDoc-userSuppliedValue"&gt;w&lt;/EM&gt;. format.&lt;/STRONG&gt;&lt;/FONT&gt; In this case, SAS does not write a note to the log.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like the follow should work, you can play around with the exact format you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;iTox_event_enc = CATX("-",
                                              MRN, 
                                             put(AdmitDate, mmddyyd10.),
                                             put(LastRecordDate, mmddyyd10.)
                                        );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;I imported data into SAS which looks like this:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;AdmitDate&lt;/TD&gt;
&lt;TD&gt;LastRecordDate&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;847545&lt;/TD&gt;
&lt;TD&gt;11/1/2020&lt;/TD&gt;
&lt;TD&gt;11/7/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the following code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data combined;
set work.Combined;
iTox_event_enc = CATX("-", MRN, AdmitDate, LastRecordDate);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The results look like:&amp;nbsp;847545-22246-22253 instead of&amp;nbsp;847545-11/01/2020-11/07/2020. is there a way to fix that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In another import instead of it looking like this after the import&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;AdmitDate&lt;/TD&gt;
&lt;TD&gt;LastRecordDate&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;847545&lt;/TD&gt;
&lt;TD&gt;11/1/2020&lt;/TD&gt;
&lt;TD&gt;11/7/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It came out like this:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;Start_EventDTS&lt;/TD&gt;
&lt;TD&gt;LastRecordDate&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;847545&lt;/TD&gt;
&lt;TD&gt;11/01/2020&lt;/TD&gt;
&lt;TD&gt;44224&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both original source documents are formatted the same but they imported differently. I want to run the same concatenation but it gives me more problems than the first import.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Apr 2021 20:56:04 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-04-28T20:56:04Z</dc:date>
    <item>
      <title>Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737725#M230003</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I imported data into SAS which looks like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;AdmitDate&lt;/TD&gt;&lt;TD&gt;LastRecordDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;847545&lt;/TD&gt;&lt;TD&gt;11/1/2020&lt;/TD&gt;&lt;TD&gt;11/7/2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data combined;
set work.Combined;
iTox_event_enc = CATX("-", MRN, AdmitDate, LastRecordDate);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The results look like:&amp;nbsp;847545-22246-22253 instead of&amp;nbsp;847545-11/01/2020-11/07/2020. is there a way to fix that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In another import instead of it looking like this after the import&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;AdmitDate&lt;/TD&gt;&lt;TD&gt;LastRecordDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;847545&lt;/TD&gt;&lt;TD&gt;11/1/2020&lt;/TD&gt;&lt;TD&gt;11/7/2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It came out like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Start_EventDTS&lt;/TD&gt;&lt;TD&gt;LastRecordDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;847545&lt;/TD&gt;&lt;TD&gt;11/01/2020&lt;/TD&gt;&lt;TD&gt;44224&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both original source documents are formatted the same but they imported differently. I want to run the same concatenation but it gives me more problems than the first import.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 20:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737725#M230003</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-04-28T20:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737727#M230004</link>
      <description>&lt;P&gt;CATX uses the underlying data, so nest it with a PUT statement to have the format honoured.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0p7wxtk0hvn83n1pveisbcp2ae9.htm" target="_self"&gt;documentation&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;H4 class="xisDoc-argument"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;item&lt;/EM&gt;&lt;/H4&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;specifies a constant, variable, or expression, either character or numeric. &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;If&amp;nbsp;&lt;EM class="xisDoc-userSuppliedValue"&gt;item&lt;/EM&gt;&amp;nbsp;is numeric, its value is converted to a character string by using the BEST&lt;EM class="xisDoc-userSuppliedValue"&gt;w&lt;/EM&gt;. format.&lt;/STRONG&gt;&lt;/FONT&gt; In this case, SAS does not write a note to the log.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like the follow should work, you can play around with the exact format you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;iTox_event_enc = CATX("-",
                                              MRN, 
                                             put(AdmitDate, mmddyyd10.),
                                             put(LastRecordDate, mmddyyd10.)
                                        );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;I imported data into SAS which looks like this:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;AdmitDate&lt;/TD&gt;
&lt;TD&gt;LastRecordDate&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;847545&lt;/TD&gt;
&lt;TD&gt;11/1/2020&lt;/TD&gt;
&lt;TD&gt;11/7/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the following code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data combined;
set work.Combined;
iTox_event_enc = CATX("-", MRN, AdmitDate, LastRecordDate);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The results look like:&amp;nbsp;847545-22246-22253 instead of&amp;nbsp;847545-11/01/2020-11/07/2020. is there a way to fix that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In another import instead of it looking like this after the import&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;AdmitDate&lt;/TD&gt;
&lt;TD&gt;LastRecordDate&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;847545&lt;/TD&gt;
&lt;TD&gt;11/1/2020&lt;/TD&gt;
&lt;TD&gt;11/7/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It came out like this:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;Start_EventDTS&lt;/TD&gt;
&lt;TD&gt;LastRecordDate&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;847545&lt;/TD&gt;
&lt;TD&gt;11/01/2020&lt;/TD&gt;
&lt;TD&gt;44224&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both original source documents are formatted the same but they imported differently. I want to run the same concatenation but it gives me more problems than the first import.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 20:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737727#M230004</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-28T20:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737730#M230005</link>
      <description>&lt;P&gt;Thanks Reeza&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was using date10. and it didn't work but this works for the first part, but it didn't on the second part where the data from the original source is mmddyy, but its being imported as 44224 instead of a date. I tried "input" to change the variable but it doesn't work. It imported as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Start_EventDTS&lt;/TD&gt;&lt;TD&gt;LastRecordDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;847545&lt;/TD&gt;&lt;TD&gt;11/1/2020&lt;/TD&gt;&lt;TD&gt;11/7/2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after the import it was:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Start_EventDTS&lt;/TD&gt;&lt;TD&gt;LastRecordDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;847545&lt;/TD&gt;&lt;TD&gt;11/01/2020&lt;/TD&gt;&lt;TD&gt;44224&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 28 Apr 2021 21:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737730#M230005</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-04-28T21:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737734#M230008</link>
      <description>&lt;P&gt;I don't know what a DATE10 format would look like, DATE7 and DATE9 are common. &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was using date10. and it didn't work but this works for the first part, but it didn't on the second part where the data from the original source is mmddyy, but its being imported as 44224 instead of a date. I tried "input" to change the variable but it doesn't work. It imported as:&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show the code you used, something from your original post no longer is true.&lt;BR /&gt;&lt;BR /&gt;This doesn't align with your initial post and the statement that it became this though. That would only happen if both were dates so is that incorrect?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;847545-22246-22253 instead of 847545-11/01/2020-11/07/2020. is there a way to fix that?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 28 Apr 2021 21:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737734#M230008</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-28T21:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737736#M230010</link>
      <description>And my guess is you're working with multiple Excel files. If that's the case you need to ensure your formats and types align across the different files after the IMPORT. Excel does not enforce types so you kinda get what you get after a PROC IMPORT and need to ensure it's imported correctly. &lt;BR /&gt;</description>
      <pubDate>Wed, 28 Apr 2021 21:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737736#M230010</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-28T21:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737737#M230011</link>
      <description>&lt;P&gt;Reeza&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you replied to was perfect, but I think either all of my post did not go through (though I can see it on my end) because if you read further down my original post I spoke about a second import.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 21:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737737#M230011</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-04-28T21:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737739#M230013</link>
      <description>&lt;P&gt;Correct, there are two imports. Both were formatted the same, but the second one for some reason imported with that fuky format for the date. I tried converting it using the input function, but to no avail.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 21:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737739#M230013</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-04-28T21:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737743#M230014</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Correct, there are two imports. Both were formatted the same, but the second one for some reason imported with that fuky format for the date. I tried converting it using the input function, but to no avail.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is a common problem with reading data from Excel files.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/Excel-to-SAS-date-format-issues/td-p/539669" target="_blank"&gt;https://communities.sas.com/t5/New-SAS-User/Excel-to-SAS-date-format-issues/td-p/539669&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737743#M230014</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-28T22:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737750#M230019</link>
      <description>&lt;P&gt;Thanks Tom&lt;/P&gt;&lt;P&gt;I tried that and got an error. Here is the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT DATAFILE= "H:\Immunotoxicity\ImmunotoxicityProgram_04.22.2021_Mine.xlsx"
	OUT= work.Patients REPLACE DBMS= XLSX;
	SHEET= Patients_Events;
	RUN;

data Patients;
set work.Patients;
LastRecordDate = input(Date,5.)+ '30DEC1899'd;
format LastRecordDate yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I got this error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;31         data Patients;
32         set work.Patients;
33         LastRecordDate = input(Date,5.)+ '30DEC1899'd;
34         format LastRecordDate yymmdd10.;
                                 _________
                                 484
NOTE 484-185: Format $YYMMDD was not found or could not be loaded.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737750#M230019</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-04-28T22:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737752#M230020</link>
      <description>&lt;P&gt;You also should have gotten other messages about SAS converting numbers into string.&lt;/P&gt;
&lt;P&gt;That is because your dataset already has a CHARACTER variable with that name.&lt;/P&gt;
&lt;P&gt;You need to create a NEW numeric variable to hold the date value.&lt;/P&gt;
&lt;P&gt;Is&amp;nbsp;LastRecordDate the variable that you already have?&amp;nbsp; Or are there 2 date variables in your PATIENTS dataset that you need to convert?&lt;/P&gt;
&lt;P&gt;Try something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Patients;
  set work.Patients;
  newvar = input(LastRecordDate ,5.)+ '30DEC1899'd;
  format newvar yymmdd10.;
  rename newvar=LastRecordDate LastRecordDate = CharDate ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want the new variable to use that same name&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737752#M230020</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-28T22:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737753#M230021</link>
      <description>&lt;P&gt;That worked absolutely PERFECT!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Tom&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737753#M230021</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-04-28T22:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737754#M230022</link>
      <description>Thanks for showing your code. &lt;BR /&gt;&lt;BR /&gt;You need to provide an informat that matches the appearance of the data so you need to apply it to the ones that look like dates, not the ones that are numeric. For the numeric ones you apply a format instead.&lt;BR /&gt;&lt;BR /&gt;If the variable is numeric after import apply a format. If the format doesn't display the correct date, then try adding the adjustment factor, 30Dec1899.&lt;BR /&gt;If the variable is character after import, use INPUT to convert, then apply the format. The INPUT() function requires the informat, which tells SAS the currently displayed format, so it should likely be something like MMDDYY10. not 5.&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-Dates/m-p/737754#M230022</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-28T22:50:36Z</dc:date>
    </item>
  </channel>
</rss>

