<?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 conversion to yymmdd10. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692778#M211111</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is some data, where I need to fetch yymmdd10. format data (e.g. 2020-06-08).&lt;/P&gt;
&lt;P&gt;which includes all Jan-Dec or January to December data with (- or / ) seperates.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data xyz;&lt;BR /&gt;date1= "08-June-2020";output;&lt;BR /&gt;date1= "31-Oct-2020";output;&lt;BR /&gt;date1= "13/August/2020"; output;&lt;BR /&gt;date1= "02/Jan/2020" ;output;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance for your help and take care.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Priya&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2020 07:46:06 GMT</pubDate>
    <dc:creator>pdhokriya</dc:creator>
    <dc:date>2020-10-20T07:46:06Z</dc:date>
    <item>
      <title>Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692778#M211111</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is some data, where I need to fetch yymmdd10. format data (e.g. 2020-06-08).&lt;/P&gt;
&lt;P&gt;which includes all Jan-Dec or January to December data with (- or / ) seperates.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data xyz;&lt;BR /&gt;date1= "08-June-2020";output;&lt;BR /&gt;date1= "31-Oct-2020";output;&lt;BR /&gt;date1= "13/August/2020"; output;&lt;BR /&gt;date1= "02/Jan/2020" ;output;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance for your help and take care.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Priya&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 07:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692778#M211111</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2020-10-20T07:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692785#M211117</link>
      <description>&lt;P&gt;Convert the strings to sas-dates, preferably during data-import. Then all you have to do is change the format to get what you want. If you can't fix the problem during import, then use a datastep and the input-function to create sas-dates.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 08:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692785#M211117</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-10-20T08:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692801#M211126</link>
      <description>Please share your program approch because this does not work for my data.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data xyz;&lt;BR /&gt;date1= "08-June-2020";output;&lt;BR /&gt;date1= "31-Oct-2020";output;&lt;BR /&gt;date1= "13/August/2020"; output;&lt;BR /&gt;date1= "02/Jan/2020" ;output;&lt;BR /&gt;run ;&lt;BR /&gt;&lt;BR /&gt;data one;&lt;BR /&gt; set xyz;&lt;BR /&gt;  newvar = input(date1, best.);&lt;BR /&gt;  format newvar yymmdd10.;&lt;BR /&gt;run;</description>
      <pubDate>Tue, 20 Oct 2020 10:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692801#M211126</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2020-10-20T10:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692802#M211127</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xyz;
   length date1 $ 20;
   date1= "08-June-2020"; output;
   date1= "31-Oct-2020"; output;
   date1= "13/August/2020"; output;
   date1= "02/Jan/2020"; output;
run;

data want;
   set xyz;
   
   newvar = input(date1, ANYDTDTE20.);
   format newvar yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Oct 2020 10:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692802#M211127</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-10-20T10:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692819#M211135</link>
      <description>3rd record is coming null. Not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Tue, 20 Oct 2020 11:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692819#M211135</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2020-10-20T11:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692821#M211137</link>
      <description>&lt;P&gt;I don't get a null when I use the code from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us the exact code you are using,&amp;nbsp;better yet show us the full complete unedited LOG from the code you ran, and the results. To show us the log, please preserve the formatting by following &lt;A href="https://communities.sas.com/t5/SAS-Programming/Invalid-datalines/m-p/692820#M211136" target="_self"&gt;these instructions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 11:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692821#M211137</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-20T11:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692838#M211152</link>
      <description>My approch is this:&lt;BR /&gt;&lt;BR /&gt;Please share yours.&lt;BR /&gt;&lt;BR /&gt;data xyz;&lt;BR /&gt;length date1 $30.;&lt;BR /&gt;date1= "08-June-2020";output;&lt;BR /&gt;date1= "31-Oct-2020";output;&lt;BR /&gt;date1= "13/August/2020"; output;&lt;BR /&gt;date1= "02/Jan/2020" ;output;&lt;BR /&gt;run ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data one;&lt;BR /&gt; set xyz;&lt;BR /&gt;array char_month(24) $20 _temporary_ ("JANUARY" "FEBRUARY" "MARCH" "APRIL" "MAY" "JUNE" "JULY" "AUGUST" "SEPTEMBER" "OCTOBER" "NOVEMBER" "DECEMBER" &lt;BR /&gt;"JAN" "FEB" "MAR" "APR" "MAY" "JUN" "JUL" "AUG" "SEP" "OCT" "NOV" "DEC");&lt;BR /&gt;array num_month (24) $20 _temporary_ ("01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" &lt;BR /&gt;"01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" );&lt;BR /&gt;&lt;BR /&gt;do j = 1 to 24 ;&lt;BR /&gt;      if strip(char_month(j)) = strip(upcase(scan (tranwrd (date1,"/","-"),2,"-"))) &lt;BR /&gt;      then cm_date=catx("-",scan (tranwrd (date1,"/","-"),3,"-"),num_month(j),scan (tranwrd (date1,"/","-"),1,"-")); &lt;BR /&gt;end; &lt;BR /&gt;drop j;&lt;BR /&gt; run;</description>
      <pubDate>Tue, 20 Oct 2020 12:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692838#M211152</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2020-10-20T12:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692841#M211154</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55374"&gt;@pdhokriya&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;3rd record is coming null. Not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Nope:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xyz;
length date1 $30.;
date1= "08-June-2020";output;
date1= "31-Oct-2020";output;
date1= "13/August/2020"; output;
date1= "02/Jan/2020" ;output;
run;

data want;
   set xyz;
   
   newvar = input(date1, ANYDTDTE20.);
   format newvar yymmdd10.;
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;date1	newvar
08-June-2020	2020-06-08
31-Oct-2020	2020-10-31
13/August/2020	2020-08-13
02/Jan/2020	2020-01-02&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Oct 2020 12:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692841#M211154</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-20T12:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692875#M211168</link>
      <description>Thank you for your quick reply and help. My approch was long but your approch is simple, short  and best, saved me time thanks again.</description>
      <pubDate>Tue, 20 Oct 2020 14:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/692875#M211168</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2020-10-20T14:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/693074#M211276</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55374"&gt;@pdhokriya&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you for your quick reply and help. My approch was long but your approch is simple, short and best, saved me time thanks again.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In fact the code you marked as solution is exactly the code i posted before.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 05:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/693074#M211276</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-10-21T05:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/693082#M211281</link>
      <description>&lt;P&gt;Please mark &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;'s post as solution, I only provided proof by adding PROC PRINT.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 06:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/693082#M211281</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-21T06:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion to yymmdd10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/693384#M211401</link>
      <description>Thank you for the solution..</description>
      <pubDate>Thu, 22 Oct 2020 04:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-to-yymmdd10/m-p/693384#M211401</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2020-10-22T04:38:56Z</dc:date>
    </item>
  </channel>
</rss>

