<?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: Convert date yymmdd10. to numeric value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-yymmdd10-to-numeric-value/m-p/808416#M318773</link>
    <description>&lt;P&gt;I created your "have" dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input date $10.;&lt;BR /&gt;datalines;&lt;BR /&gt;2022-04-18&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;DATA want;&lt;BR /&gt;format n yymmdd10.;&lt;BR /&gt;SET have;&lt;/P&gt;
&lt;P&gt;n=input(date, yymmdd10.);&lt;BR /&gt;put n= ;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Apr 2022 20:23:12 GMT</pubDate>
    <dc:creator>Michael_Harper</dc:creator>
    <dc:date>2022-04-18T20:23:12Z</dc:date>
    <item>
      <title>Convert date yymmdd10. to numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-yymmdd10-to-numeric-value/m-p/808409#M318771</link>
      <description>&lt;P&gt;I have a variable called date that's in the format yymmdd10., and I need to convert it in a numeric value, for example: 2022-04-18 will be converted into 20220418 (or look different, as long as it's a number) as a numeric variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried this code but it doesn't work. the output variable n is all empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA want;&lt;BR /&gt;SET have;&lt;/P&gt;&lt;P&gt;n=input(put(date, yymmdd10.), 8.);&lt;BR /&gt;put n=;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;appreciate the help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 20:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-yymmdd10-to-numeric-value/m-p/808409#M318771</guid>
      <dc:creator>noelle12</dc:creator>
      <dc:date>2022-04-18T20:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date yymmdd10. to numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-yymmdd10-to-numeric-value/m-p/808414#M318772</link>
      <description>&lt;P&gt;Just change the format to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yymmddn8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This changes the appearance. If you really need to change the underlying value, then try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
     date='18APR2022'd;
     new_date=vvalue(date);
     format date yymmddn8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Apr 2022 20:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-yymmdd10-to-numeric-value/m-p/808414#M318772</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-18T20:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date yymmdd10. to numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-yymmdd10-to-numeric-value/m-p/808416#M318773</link>
      <description>&lt;P&gt;I created your "have" dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input date $10.;&lt;BR /&gt;datalines;&lt;BR /&gt;2022-04-18&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;DATA want;&lt;BR /&gt;format n yymmdd10.;&lt;BR /&gt;SET have;&lt;/P&gt;
&lt;P&gt;n=input(date, yymmdd10.);&lt;BR /&gt;put n= ;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 20:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-yymmdd10-to-numeric-value/m-p/808416#M318773</guid>
      <dc:creator>Michael_Harper</dc:creator>
      <dc:date>2022-04-18T20:23:12Z</dc:date>
    </item>
  </channel>
</rss>

