<?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: data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254424#M48526</link>
    <description>&lt;P&gt;There is actually two instances where you might want character dates - ISO dates for instance are character. &amp;nbsp;The other is for display purposes, most times put to format is fine, but sometimes you may want additional information for report purposes. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I totally agree with you, unless there is a very good reason there is no reason to not use numeric date or time variables as they are far easier to use. &amp;nbsp;I suspect he is trying to put these in macro list or something similar (in which case don't).&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2016 09:26:18 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-03-04T09:26:18Z</dc:date>
    <item>
      <title>Convert date format in a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254407#M48518</link>
      <description>&lt;P&gt;Hi I have a question in my code;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have date values in character format;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exp: &amp;nbsp;Date &amp;nbsp;&amp;nbsp;2015-09-25&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to convert the date into&amp;nbsp;2015/09/25 which is in character format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code:&lt;/P&gt;
&lt;P&gt;date1=input(date,yymmdd10.);&lt;BR /&gt;format date yymmdds10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the code resulted in value numeric format. I need the value in chracter format.&amp;nbsp;&lt;SPAN&gt;2015/09/25. Please help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 08:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254407#M48518</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-03-04T08:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254408#M48519</link>
      <description>&lt;P&gt;date = translate(date,"/","-");&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 04:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254408#M48519</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-03-04T04:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254411#M48520</link>
      <description>Why do need it in char? Storing dates as numerical is much more flexible. There are tons of date functions available to you, and you could change the date format at blink of a second - no ned to rewrite to do conversion.</description>
      <pubDate>Fri, 04 Mar 2016 05:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254411#M48520</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-04T05:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254424#M48526</link>
      <description>&lt;P&gt;There is actually two instances where you might want character dates - ISO dates for instance are character. &amp;nbsp;The other is for display purposes, most times put to format is fine, but sometimes you may want additional information for report purposes. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I totally agree with you, unless there is a very good reason there is no reason to not use numeric date or time variables as they are far easier to use. &amp;nbsp;I suspect he is trying to put these in macro list or something similar (in which case don't).&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 09:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254424#M48526</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-04T09:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date format in a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254440#M48529</link>
      <description>&lt;P&gt;You can use the inverse of INPUT, PUT:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date2=put(date1, yymmdds10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I refrain from disputing your expressed need for this. I think it is out of order until you have been asked questions on the matter, which has not happened. And I won't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;-Jan.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 11:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254440#M48529</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-03-04T11:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date format in a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254568#M48572</link>
      <description>&lt;P&gt;Hi all,,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much. Both codes are working for me as I am validating a dataset using proc compare. Thank yoiu.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 18:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-format-in-a-character-variable/m-p/254568#M48572</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-03-04T18:39:30Z</dc:date>
    </item>
  </channel>
</rss>

