<?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: compare 2 date values in YYYY.WK format in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270634#M7499</link>
    <description>&lt;P&gt;BEST7 is not a date format, yyyy.wk would be a date format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regardless, since the years/weeks are in chronological order you can compare the values directly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, it's best to create a SAS date to do comparisons.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2016 07:30:21 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-05-16T07:30:21Z</dc:date>
    <item>
      <title>compare 2 date values in YYYY.WK format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270630#M7496</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want compare 2 date values available in year.week format. Is there is any way to compare 2 date which one is bigger.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Call_week&lt;/STRONG&gt;&lt;/U&gt; &amp;nbsp;&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;Dcall_week&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;2014.01 &amp;nbsp; &amp;nbsp; 2014.02&lt;/P&gt;
&lt;P&gt;2016.11 &amp;nbsp; &amp;nbsp;&amp;nbsp;2016.10&lt;/P&gt;
&lt;P&gt;2015.18 &amp;nbsp; &amp;nbsp;&amp;nbsp;2015.20&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Rajesh&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 07:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270630#M7496</guid>
      <dc:creator>chirumalla</dc:creator>
      <dc:date>2016-05-16T07:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 date values in YYYY.WK format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270632#M7497</link>
      <description>&lt;P&gt;Are the dates SAS dates, ie numeric with a date format?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 07:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270632#M7497</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-16T07:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 date values in YYYY.WK format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270633#M7498</link>
      <description>&lt;P&gt;Yes. Both are Numaric and best7. format&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 07:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270633#M7498</guid>
      <dc:creator>chirumalla</dc:creator>
      <dc:date>2016-05-16T07:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 date values in YYYY.WK format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270634#M7499</link>
      <description>&lt;P&gt;BEST7 is not a date format, yyyy.wk would be a date format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regardless, since the years/weeks are in chronological order you can compare the values directly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, it's best to create a SAS date to do comparisons.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 07:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270634#M7499</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-16T07:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 date values in YYYY.WK format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270635#M7500</link>
      <description>&lt;P&gt;Sorry for the inconveniecne. Below is the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Call_week &amp;nbsp; &amp;nbsp; &amp;nbsp;Dcall_week&lt;/P&gt;
&lt;P&gt;2014.01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;02.2014&lt;/P&gt;
&lt;P&gt;2016.11 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;10.2016.&lt;/P&gt;
&lt;P&gt;2015.18 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;20.2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is possible to compare these two columns, could you please share the logic?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 07:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270635#M7500</guid>
      <dc:creator>chirumalla</dc:creator>
      <dc:date>2016-05-16T07:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 date values in YYYY.WK format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270639#M7501</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your variables are numeric (as you mentioned in a previous post) than you compare them as comparing 2 numbers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g. if Call_week gt Dcall_week then new_var=Call_week;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your variables are character you transform them into numeric variables using &lt;STRONG&gt;input &lt;/STRONG&gt;function and the appropriate &lt;STRONG&gt;informat.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here you can find the &lt;STRONG&gt;SAS INFORMATS BY CATEGORY&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001239776.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001239776.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Afterwards the comparison will also resume to number comparing.&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 08:23:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270639#M7501</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-05-16T08:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 date values in YYYY.WK format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270640#M7502</link>
      <description>&lt;P&gt;Post some example data from your dataset - as a datastep so we can read it in directly as it is in your dataset. &amp;nbsp;The reason is 02.2014 is not best7. format, it is either text or a Z type format. &amp;nbsp;Also post what you want the output to look like, what do you mean compare? &amp;nbsp;Difference in days/weeks/years, same month - its not clear from your post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 08:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270640#M7502</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-05-16T08:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 date values in YYYY.WK format</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270663#M7503</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33244"&gt;@chirumalla&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Sorry for the inconveniecne. Below is the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Call_week &amp;nbsp; &amp;nbsp; &amp;nbsp;Dcall_week&lt;/P&gt;
&lt;P&gt;2014.01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;02.2014&lt;/P&gt;
&lt;P&gt;2016.11 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;10.2016.&lt;/P&gt;
&lt;P&gt;2015.18 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;20.2015&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is possible to compare these two columns, could you please share the logic?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is not the same as your original post and inconsistent with your answer regarding the variable type and format. Please confirm your data structure and variable types, preferably by posting the output from proc contents.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 10:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/compare-2-date-values-in-YYYY-WK-format/m-p/270663#M7503</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-16T10:34:33Z</dc:date>
    </item>
  </channel>
</rss>

