<?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: dealing with two different date formats in a single column in proc sql in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567017#M11421</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255530"&gt;@Abhinav26&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;and yes only these two formats i have&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You already received defective data. How can you be sure you won't have further defects when the source has already proven itself to be unreliable?&lt;/P&gt;
&lt;P&gt;Return to sender, and require consistent formatting of data.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2019 19:04:48 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-06-18T19:04:48Z</dc:date>
    <item>
      <title>dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567008#M11414</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting two different date formats from the database for single variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 386px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30382iF9318D3BE797C690/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the output to be consistent with mmddyy10. format.&lt;/P&gt;&lt;P&gt;How to do it ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 18:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567008#M11414</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-06-18T18:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567011#M11416</link>
      <description>The variable is character. Is that the only two formats that you have? For that first one is the date value supposed to be April 6, 2019 or June 4, 2019?</description>
      <pubDate>Tue, 18 Jun 2019 18:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567011#M11416</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-18T18:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567014#M11418</link>
      <description>&lt;P&gt;value should be June 4, 2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 19:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567014#M11418</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-06-18T19:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567015#M11419</link>
      <description>and yes only these two formats i have</description>
      <pubDate>Tue, 18 Jun 2019 19:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567015#M11419</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-06-18T19:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567017#M11421</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255530"&gt;@Abhinav26&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;and yes only these two formats i have&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You already received defective data. How can you be sure you won't have further defects when the source has already proven itself to be unreliable?&lt;/P&gt;
&lt;P&gt;Return to sender, and require consistent formatting of data.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 19:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567017#M11421</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-18T19:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567018#M11422</link>
      <description>differently formatted data is based on another variable on the right side, i.e. quest_id. So, there are only these two types of date formats.&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Jun 2019 19:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567018#M11422</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-06-18T19:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567020#M11423</link>
      <description>Is there any solution to this ?</description>
      <pubDate>Tue, 18 Jun 2019 19:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567020#M11423</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-06-18T19:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567021#M11424</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

x=length(scan(due_date10X. 1, '-'));
if x = 4 then due_date_want = input(due_date10X, yymmdd10.);
else due_date_want = input(due_date10X, mmddyy10.);

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;First take the first part of the string using SCAn(). If it's a length of 4, that's the YYMMDD format. Otherwise use MMDDYY for the format.&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/255530"&gt;@Abhinav26&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting two different date formats from the database for single variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 386px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30382iF9318D3BE797C690/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want the output to be consistent with mmddyy10. format.&lt;/P&gt;
&lt;P&gt;How to do it ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 19:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567021#M11424</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-18T19:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567022#M11425</link>
      <description>&lt;P&gt;Thanks but i want new variable with values in mmddyy10. format for both rows and that too using proc SQL.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 19:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567022#M11425</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-06-18T19:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567033#M11427</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255530"&gt;@Abhinav26&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks but i want new variable with values in mmddyy10. format for both rows and that too using proc SQL.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's what it does, did you try it? &lt;STRIKE&gt;There's no way I can know you're using SQL... &lt;/STRIKE&gt;(EDIT: My bad, It was in your subject but not in the question. Should be an easy change though)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can switch the IF/THEN statements to a CASE statement or use the Query builder to replicate the functions using the advanced computation features.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Give it a shot and if you can't figure it out, post your code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 19:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567033#M11427</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-18T19:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with two different date formats in a single column in proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567070#M11436</link>
      <description>&lt;P&gt;It worked, Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 21:00:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dealing-with-two-different-date-formats-in-a-single-column-in/m-p/567070#M11436</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-06-18T21:00:32Z</dc:date>
    </item>
  </channel>
</rss>

