<?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 Date Formatting in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/796947#M255796</link>
    <description>&lt;P&gt;I have a dataset that has the following columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year - Numerical - 2021&lt;/P&gt;&lt;P&gt;Date - Character - 07/03&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to get a numerical day_skey that takes the two columns and creates the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;day_skey - 20210703&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tips on how to get my desired date field?&lt;/P&gt;</description>
    <pubDate>Thu, 17 Feb 2022 18:11:29 GMT</pubDate>
    <dc:creator>Sas_noob25</dc:creator>
    <dc:date>2022-02-17T18:11:29Z</dc:date>
    <item>
      <title>Date Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/796947#M255796</link>
      <description>&lt;P&gt;I have a dataset that has the following columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year - Numerical - 2021&lt;/P&gt;&lt;P&gt;Date - Character - 07/03&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to get a numerical day_skey that takes the two columns and creates the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;day_skey - 20210703&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tips on how to get my desired date field?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 18:11:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/796947#M255796</guid>
      <dc:creator>Sas_noob25</dc:creator>
      <dc:date>2022-02-17T18:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/796948#M255797</link>
      <description>&lt;P&gt;Use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lefunctionsref/p0bo5thbfrcab1n1menkqxq2suiv.htm" target="_self"&gt;MDY function&lt;/A&gt; and the yymmddn8. format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   year = 2021;
   date = '07/03';
   dt = mdy(scan(date, 1, '/'), scan(date, 2, '/'), year);
   put dt = yymmddn8.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 18:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/796948#M255797</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-02-17T18:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/796968#M255805</link>
      <description>&lt;P&gt;If you don't want to see the log "NOTE: Character values have been converted to numeric values at the places given by: "&amp;nbsp; one of several ways:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   year = 2021;
   date = '07/03';
   dt = Input(catx('/',date,year),mmddyy10.);
   put dt = yymmddn8.;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Feb 2022 18:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/796968#M255805</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-17T18:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797042#M255814</link>
      <description>&lt;P&gt;Thanks for your response. I've tried doing your example, but am getting the following for the desired date field:&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="Sas_noob25_0-1645127683305.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68615i1D73462F3D2B1465/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sas_noob25_0-1645127683305.png" alt="Sas_noob25_0-1645127683305.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 19:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797042#M255814</guid>
      <dc:creator>Sas_noob25</dc:creator>
      <dc:date>2022-02-17T19:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797044#M255816</link>
      <description>&lt;P&gt;I tried both options but am still getting the same result for the day_skey&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="Sas_noob25_0-1645127683305.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68615i1D73462F3D2B1465/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sas_noob25_0-1645127683305.png" alt="Sas_noob25_0-1645127683305.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 20:01:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797044#M255816</guid>
      <dc:creator>Sas_noob25</dc:creator>
      <dc:date>2022-02-17T20:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797045#M255817</link>
      <description>&lt;P&gt;These are valid SAS date values (count of days starting at 1960-01-01), but you need to assign a date format to make them human-readable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format day_skey yymmdd10.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Feb 2022 20:01:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797045#M255817</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-17T20:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797050#M255821</link>
      <description>&lt;P&gt;Thank you all! I just needed to format that date, it wasn't working with the put statement for some reason.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 20:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797050#M255821</guid>
      <dc:creator>Sas_noob25</dc:creator>
      <dc:date>2022-02-17T20:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797056#M255825</link>
      <description>&lt;P&gt;The PUT state results appear in the LOG (or if you have a FILE statement in the named file).&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 20:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formatting/m-p/797056#M255825</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-17T20:24:40Z</dc:date>
    </item>
  </channel>
</rss>

