<?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 Restrict date to mm/dd/yyyy format from input csv file and flag other rows with diff format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Restrict-date-to-mm-dd-yyyy-format-from-input-csv-file-and-flag/m-p/306918#M312637</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i have input file which&amp;nbsp;i need to read and check the format of column in the file should be MM/DD/YYYY. If it is any other format like MM-DD-YYYY i need to flag it to remove it. What will be best possible solution?. i am using informat mmddyy10. but it reads both format which is expected.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2016 19:06:52 GMT</pubDate>
    <dc:creator>sasuser101</dc:creator>
    <dc:date>2016-10-24T19:06:52Z</dc:date>
    <item>
      <title>Restrict date to mm/dd/yyyy format from input csv file and flag other rows with diff format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Restrict-date-to-mm-dd-yyyy-format-from-input-csv-file-and-flag/m-p/306918#M312637</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i have input file which&amp;nbsp;i need to read and check the format of column in the file should be MM/DD/YYYY. If it is any other format like MM-DD-YYYY i need to flag it to remove it. What will be best possible solution?. i am using informat mmddyy10. but it reads both format which is expected.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 19:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Restrict-date-to-mm-dd-yyyy-format-from-input-csv-file-and-flag/m-p/306918#M312637</guid>
      <dc:creator>sasuser101</dc:creator>
      <dc:date>2016-10-24T19:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict date to mm/dd/yyyy format from input csv file and flag other rows with diff format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Restrict-date-to-mm-dd-yyyy-format-from-input-csv-file-and-flag/m-p/306931#M312638</link>
      <description>&lt;P&gt;If you don't like the - then you may want to&amp;nbsp;read the values as character first then search for &amp;nbsp;for any other character than / in the character value. If you data is consistetn then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;flag = &amp;nbsp;(index(characterdate,'/')=0 );&lt;/P&gt;
&lt;P&gt;would set a flag of 1 for no / in the value.&lt;/P&gt;
&lt;P&gt;then likely follow with&lt;/P&gt;
&lt;P&gt;If flag=0 then datevalue = input(characterdate,mmddyy10.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 19:39:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Restrict-date-to-mm-dd-yyyy-format-from-input-csv-file-and-flag/m-p/306931#M312638</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-24T19:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict date to mm/dd/yyyy format from input csv file and flag other rows with diff format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Restrict-date-to-mm-dd-yyyy-format-from-input-csv-file-and-flag/m-p/306932#M312639</link>
      <description>&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;infile ...;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;input&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;datex $10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; daten = input(datex, mmddyy10.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; IF daten = . or&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; substr(datex,3,1) ne '/' or&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;substr(datex,6,1) ne '/'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; then flag = 1;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; else flag = 0;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 19:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Restrict-date-to-mm-dd-yyyy-format-from-input-csv-file-and-flag/m-p/306932#M312639</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-10-24T19:40:37Z</dc:date>
    </item>
  </channel>
</rss>

