<?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 to Change Char variable into Date format. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115352#M23761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case sanjeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may follow the below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data xyz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_date=input(date,yymmdd8.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format new_date date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jan 2013 14:24:48 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2013-01-04T14:24:48Z</dc:date>
    <item>
      <title>How to Change Char variable into Date format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115348#M23757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy New year to all SAS People..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a question about variable conversion from char to date..&lt;/P&gt;&lt;P&gt;I am having a dataset and DOB is the one of the variable in that dataset.&lt;/P&gt;&lt;P&gt;the value in that variable is like 20120131,20120215(YYYYMMDD).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to convert this variable into date format..&lt;/P&gt;&lt;P&gt;i am using bellow logic and it working perfectly..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;Data&amp;nbsp; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;input date $20. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;20120102&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;20120108&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;20120110&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;20120131&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;data y;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;set test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;Format date1 date9.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;date=strip(subs&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;tr(date,5,2)||'&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;/'||substr(date&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;,7,2)||'/'||sub&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;str(date,1,4));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;date1 =input(substr(s&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;trip(date),1,10&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;),MMDDYY10.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;PRoc print;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;.but my strong believe is i am doing bit tricky ,we do this in more simple way by using formats and informats..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;Could any body suggest me how to accomplish this task in a simple way???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;Thanks in Advance..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;Regards..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;Sanjeev.K&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 13:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115348#M23757</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2013-01-04T13:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Char variable into Date format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115349#M23758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanjeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this is what you were looking for&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data&amp;nbsp; test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input date yymmdd8. ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format date date9.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;20120102&lt;/P&gt;&lt;P&gt;20120108&lt;/P&gt;&lt;P&gt;20120110&lt;/P&gt;&lt;P&gt;20120131&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 14:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115349#M23758</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-01-04T14:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Char variable into Date format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115350#M23759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="WordSection1"&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="; color: #000000; font-size: 10pt; background: white; font-family: arial,helvetica,sans-serif;"&gt;Hi Sanjeev&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="; color: #000000; font-size: 10pt; background: white; font-family: arial,helvetica,sans-serif;"&gt;Jag's suggestion is probably the simplest but if you needed to specify a format that isn't built in, &lt;/SPAN&gt;&lt;SPAN style="; color: #000000; font-size: 10pt; background: white; font-family: arial,helvetica,sans-serif;"&gt;We do this sort of task using Informats as you suggested.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="; color: #000000; font-size: 10pt; background: white; font-family: arial,helvetica,sans-serif;"&gt;the code blow will create an informat called MyDteFmt to cover all dates from 01Jan200 to 31Dec2020. you could put this in the autoexec for an EG project or even for the workspace server to make it available to all future processes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE" style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;SPAN class="SpellE"&gt;infmt&lt;/SPAN&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;SPAN class="SpellE"&gt;fmtname&lt;/SPAN&gt; $&lt;/SPAN&gt;&lt;SPAN style="; color: teal; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; type $&lt;/SPAN&gt;&lt;SPAN style="; color: teal; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; label &lt;/SPAN&gt;&lt;SPAN style="; color: teal; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; start $&lt;/SPAN&gt;&lt;SPAN style="; color: teal; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;9&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: white; font-size: 11.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;retain&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;SPAN class="SpellE"&gt;fmtname&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="color: purple; background: white; font-family: 'Courier New';"&gt;"&lt;SPAN class="SpellE"&gt;MyDteFmt&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; label = &lt;/SPAN&gt;&lt;SPAN style="; color: teal; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;'01Jan2000'd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;to&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: teal; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;'31Dec2020'd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;SPAN class="GramE"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start&lt;/SPAN&gt; = cat(put(year(label),&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;z4.&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;), put(month(label), &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;z2.&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;), put(day(label), &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;z2.&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;))&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&lt;SPAN class="GramE"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type&lt;/SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: purple; background: white; font-family: 'Courier New';"&gt;"I"&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: green; background: white; font-family: 'Courier New';"&gt;/* numeric &lt;SPAN class="SpellE"&gt;InFormat&lt;/SPAN&gt; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE"&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE"&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE"&gt;&lt;SPAN style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE" style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;format&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;cntlin&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;=&lt;SPAN class="SpellE"&gt;infmt&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE"&gt;&lt;SPAN style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE" style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;datasets&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;lib&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;=work &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;memtype&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;=data &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;force&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;nowarn&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;nolist&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;SPAN class="SpellE"&gt;infmt&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE" style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style=": ; color: #000000; background: white; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;With this run your code would look something like this... &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="; color: navy; font-size: 11.0pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; date &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cards&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: #FFFFC0; font-size: 11.0pt; font-family: 'Courier New';"&gt;20120102&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: #FFFFC0; font-size: 11.0pt; font-family: 'Courier New';"&gt;20120108&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: #FFFFC0; font-size: 11.0pt; font-family: 'Courier New';"&gt;20120110&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: #FFFFC0; font-size: 11.0pt; font-family: 'Courier New';"&gt;20120131&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE" style="; color: navy; font-size: 11.0pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE" style="; color: navy; font-size: 11.0pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; y;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: blue; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Format&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; date1 &lt;/SPAN&gt;&lt;SPAN class="GramE"&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; background: white; font-size: 11.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1 =&lt;SPAN class="GramE"&gt;input(&lt;/SPAN&gt;strip(date),&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;MyDteFmt&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN class="GramE" style="; color: navy; font-size: 11.0pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="; color: navy; font-size: 11.0pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: navy; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;SPAN class="GramE" style="; line-height: 115%; color: navy; font-size: 11.0pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;SPAN style=": ; color: #000000; background: white; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;SPAN style=": ; color: #000000; background: white; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;Tim. &lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 14:13:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115350#M23759</guid>
      <dc:creator>TimCampbell</dc:creator>
      <dc:date>2013-01-04T14:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Char variable into Date format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115351#M23760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jag..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually i am getting data from client.so i ca not use dataline or cards in this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for demonstration i used cards to create a dataset..&lt;/P&gt;&lt;P&gt;If i apply your solution i am getting bellow error..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data xyz;&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;informat date yymmdd8.;&lt;/P&gt;&lt;P&gt;format date Date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR : Variable date has been defined as both character and numeric&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sanjeev.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 14:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115351#M23760</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2013-01-04T14:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Char variable into Date format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115352#M23761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case sanjeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may follow the below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data xyz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_date=input(date,yymmdd8.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format new_date date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 14:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115352#M23761</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-01-04T14:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to Change Char variable into Date format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115353#M23762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all for quick response ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgards..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sanjeev.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 16:22:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Change-Char-variable-into-Date-format/m-p/115353#M23762</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2013-01-04T16:22:09Z</dc:date>
    </item>
  </channel>
</rss>

