<?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 Do I Reformat A Date In a Table? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785274#M250591</link>
    <description>&lt;P&gt;If your source table is actually a SAS data set and the value is a SAS date value, i.e. numeric with the SAS format ddmmyy8 or similar applied all you need is to change the existing format.&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table table_b as select

Account_Number as Number,
FIRST_NAME_TEXT,
SURNAME_TEXT,
Date_Of_Birth format=yymmddn8.

from table_a;
quit;&lt;/PRE&gt;
&lt;P&gt;If you actually want a 3-digit year value though you will have to roll your own and likely have all sorts of fun.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your table is not SAS or your value is character or plain numeric, ie. 301112 with a format like Best or f6. then we need more details as you need to create the SAS date value.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 21:20:07 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-12-09T21:20:07Z</dc:date>
    <item>
      <title>How Do I Reformat A Date In a Table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785272#M250590</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below table generates 'Date_Of_Birth' as a date output of DDMMYY and I need YYYMMDD, can anyone help please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table table_b as select&lt;BR /&gt;&lt;BR /&gt;Account_Number as Number,&lt;BR /&gt;FIRST_NAME_TEXT,&lt;BR /&gt;SURNAME_TEXT,&lt;BR /&gt;Date_Of_Birth&lt;BR /&gt;&lt;BR /&gt;from table_a;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785272#M250590</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2021-12-09T21:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Reformat A Date In a Table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785274#M250591</link>
      <description>&lt;P&gt;If your source table is actually a SAS data set and the value is a SAS date value, i.e. numeric with the SAS format ddmmyy8 or similar applied all you need is to change the existing format.&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table table_b as select

Account_Number as Number,
FIRST_NAME_TEXT,
SURNAME_TEXT,
Date_Of_Birth format=yymmddn8.

from table_a;
quit;&lt;/PRE&gt;
&lt;P&gt;If you actually want a 3-digit year value though you will have to roll your own and likely have all sorts of fun.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your table is not SAS or your value is character or plain numeric, ie. 301112 with a format like Best or f6. then we need more details as you need to create the SAS date value.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785274#M250591</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-09T21:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Reformat A Date In a Table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785275#M250592</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table table_b as select
    Account_Number as Number,
    FIRST_NAME_TEXT,
    SURNAME_TEXT,
    Date_Of_Birth format=yymmdd8.
    from table_a;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785275#M250592</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-09T21:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Reformat A Date In a Table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785276#M250593</link>
      <description>This is working to rearrange the numbers but I needed separators sorry, so I need it to be YYYY/MM/DD &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785276#M250593</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2021-12-09T21:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Reformat A Date In a Table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785277#M250594</link>
      <description>&lt;P&gt;The date format it is stored in is DATE9. and I need it to read yyyy/mm/dd.&amp;nbsp; Sorry I missed out a Y earlier &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785277#M250594</guid>
      <dc:creator>NewToAllThis</dc:creator>
      <dc:date>2021-12-09T21:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Reformat A Date In a Table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785278#M250595</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/356814"&gt;@NewToAllThis&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;This is working to rearrange the numbers but I needed separators sorry, so I need it to be YYYY/MM/DD &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Spelling counts. The YYMMDD&lt;STRONG&gt;S&lt;/STRONG&gt;10. format will add slash&amp;nbsp;&amp;nbsp; The YYMMDDx has several characters that replace the X to change delimiters.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Reformat-A-Date-In-a-Table/m-p/785278#M250595</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-09T21:45:19Z</dc:date>
    </item>
  </channel>
</rss>

