<?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: Proc Report tryng to use where expression in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204114#M50874</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much &lt;STRONG style="font-size: 11.818181991577148px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="5253" data-username="Astounding" href="https://communities.sas.com/people/Astounding" id="jive-525349498902731641186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Astounding&lt;/A&gt;&lt;/STRONG&gt; for the explanation and it did worked very well. Only thing that I did is that I follow your suggestion and I went back to the data set and predefined a variable with the following statement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Data&amp;nbsp; Bomgartestnew;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Bomgartestnew;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Day=D__but;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If Index (D__but,'01-05-2015')&amp;nbsp;&amp;nbsp; Then Day="Hier";else Day="Mois";&lt;/P&gt;&lt;P&gt;&amp;nbsp; Mois=D__but;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If Index (D__but,'05-2015')&amp;nbsp;&amp;nbsp; Then Mois="Mois";&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now I can use my Where expression &lt;STRONG style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where Day eq "Hier".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right I have to know more about&amp;nbsp; how SAS Stores dates and I will. I've been using SAS for 3 weeks and wow this is awesome !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp; very Much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assis &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2015 14:29:11 GMT</pubDate>
    <dc:creator>AssisJadue</dc:creator>
    <dc:date>2015-06-12T14:29:11Z</dc:date>
    <item>
      <title>Proc Report tryng to use where expression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204111#M50871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , I'am new in SAS and i'm very excited so far with this amazing and powerful program/tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wonder if any expert can help me out to get this program to work. I'am trying to use the &lt;STRONG&gt;"where"&lt;/STRONG&gt; expression to find a date in a &lt;STRONG&gt;Proc Report&lt;/STRONG&gt; procedure but after many web pages , I have not found my answer.here is my code so far;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Report&amp;nbsp; data=Bomgartestnew nowindows;&lt;/P&gt;&lt;P&gt;&amp;nbsp; column Composante Day&amp;nbsp; &lt;STRONG&gt;D__but&lt;/STRONG&gt; ("Reçus" Abandon_formule M_A_D );&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Composante / group descending;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define abandon_formule /analysis sum "Hier";&lt;/P&gt;&lt;P&gt;&amp;nbsp; rbreak after / summarize;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where Day eq "Hier"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;**another option/***&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Where D__but eq '01-05-2015';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;***/or using a date format like 01-05-2015 because I have another variable with that kind of observations********/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that I'm not doing the right thing as both "where" could not find any results and this is the error that I got;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;ERROR: WHERE clause operator requires compatible variables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hoping that someone out there can give me a hand. It would be very appreciate it.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Francis&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 20:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204111#M50871</guid>
      <dc:creator>AssisJadue</dc:creator>
      <dc:date>2015-06-11T20:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report tryng to use where expression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204112#M50872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The two WHERE statements are failing for very different reasons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where Day eq "Hier"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The WHERE statement is supposed to examine the incoming observations to determine which ones to use in PROC REPORT.&amp;nbsp; You can't refer to a calculated field, only to pre-existing fields.&amp;nbsp; Even if the field existed in the incoming data set, you would have to refer to the variable by its name (ABANDON_FORMULE), not by its label ("Hier").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Where D__but eq '01-05-2015';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS stores dates on a different scale that what you are expecting.&amp;nbsp; It's something you will need to study at some point along the way.&amp;nbsp; For now, the error message is telling you the D__but is a numeric variable and thus can't be compared to a character string.&amp;nbsp; D__but probably has a format connected with it that makes it print in MMDDYY form, but its actual value is numeric.&amp;nbsp; Try this version and see what happens:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Where D__but eq '05JAN2015'd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 21:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204112#M50872</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-06-11T21:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report tryng to use where expression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204113#M50873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Post it at ODS AND REPORT Forum , since it is a question about proc report . Cynthia is there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 14:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204113#M50873</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-06-12T14:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report tryng to use where expression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204114#M50874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much &lt;STRONG style="font-size: 11.818181991577148px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="5253" data-username="Astounding" href="https://communities.sas.com/people/Astounding" id="jive-525349498902731641186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Astounding&lt;/A&gt;&lt;/STRONG&gt; for the explanation and it did worked very well. Only thing that I did is that I follow your suggestion and I went back to the data set and predefined a variable with the following statement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Data&amp;nbsp; Bomgartestnew;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Bomgartestnew;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Day=D__but;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If Index (D__but,'01-05-2015')&amp;nbsp;&amp;nbsp; Then Day="Hier";else Day="Mois";&lt;/P&gt;&lt;P&gt;&amp;nbsp; Mois=D__but;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If Index (D__but,'05-2015')&amp;nbsp;&amp;nbsp; Then Mois="Mois";&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now I can use my Where expression &lt;STRONG style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where Day eq "Hier".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right I have to know more about&amp;nbsp; how SAS Stores dates and I will. I've been using SAS for 3 weeks and wow this is awesome !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp; very Much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assis &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 14:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204114#M50874</guid>
      <dc:creator>AssisJadue</dc:creator>
      <dc:date>2015-06-12T14:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report tryng to use where expression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204115#M50875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xia ... I'll do it next time,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 14:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-tryng-to-use-where-expression/m-p/204115#M50875</guid>
      <dc:creator>AssisJadue</dc:creator>
      <dc:date>2015-06-12T14:30:28Z</dc:date>
    </item>
  </channel>
</rss>

