<?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: case when when applying in hash object in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618499#M19236</link>
    <description>&lt;P&gt;Actually the msg got misinterpreted.Sorry for that. My task is to convert this code to hash object from SQL. This code is running fine but my job is to look for ways to convert the codes into hash objects&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2020 11:05:37 GMT</pubDate>
    <dc:creator>Bharat_P</dc:creator>
    <dc:date>2020-01-20T11:05:37Z</dc:date>
    <item>
      <title>case when when applying in hash object</title>
      <link>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618462#M19227</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc so;
create table sample as 
select make
          ,type
          ,count(case when flag="euro" then MEET end) as Euro
          ,sum(case when flag="euro" then Invoice end) as Done
from help.cars
group by 1,2
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;need to convert this to hash coding. if someone can help the it will be great( writing sql as so, sashelp as help,msrp as Meet as I am not being able to paste codes which are grammatically incorrect.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 06:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618462#M19227</guid>
      <dc:creator>Bharat_P</dc:creator>
      <dc:date>2020-01-20T06:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: case when when applying in hash object</title>
      <link>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618463#M19228</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/305102"&gt;@Bharat_P&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you provide some sample data and what your desired result look like?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 06:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618463#M19228</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-01-20T06:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: case when when applying in hash object</title>
      <link>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618498#M19235</link>
      <description>&lt;P&gt;There are two major reasons why your request is not possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, you ask for hashing.&amp;nbsp; Hashing is a DATA step tool only, and cannot be used within PROC SQL.&amp;nbsp; So you can pick one or the other, but not both.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, you tell us that the code you posted doesn't work.&amp;nbsp; But you assume that we know what it is supposed to accomplish.&amp;nbsp; That's your job, to explain what the result is going to be, especially when your code doesn't work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Taking an educated guess at half of the problem (the INVOICE part), you noted that this doesn't work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; ,sum(case when flag="euro" then Invoice end) as Done&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm guessing that this is what is needed instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; ,sum((flag="euro") * Invoice) as Done&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Perhaps you can test that (without the MEET logic that doesn't work) to see if it does part of what you want.&amp;nbsp; But the logic for MEET is much more obscure and you will need to explain what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 11:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618498#M19235</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-01-20T11:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: case when when applying in hash object</title>
      <link>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618499#M19236</link>
      <description>&lt;P&gt;Actually the msg got misinterpreted.Sorry for that. My task is to convert this code to hash object from SQL. This code is running fine but my job is to look for ways to convert the codes into hash objects&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 11:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618499#M19236</guid>
      <dc:creator>Bharat_P</dc:creator>
      <dc:date>2020-01-20T11:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: case when when applying in hash object</title>
      <link>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618562#M19238</link>
      <description>&lt;P&gt;Your issue looks like a simple summary operation, which is not the domain of hash objects.&lt;/P&gt;
&lt;P&gt;Please supply example data, and the expected result.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 14:58:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618562#M19238</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-20T14:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: case when when applying in hash object</title>
      <link>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618743#M19270</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/305102"&gt;@Bharat_P&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Actually the msg got misinterpreted.Sorry for that. My task is to convert this code to hash object from SQL. This code is running fine but my job is to look for ways to convert the codes into hash objects&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;1. The code you've posted is NOT running fine but returns errors. Please fix the code so we can understand the logic you're after.&lt;/P&gt;
&lt;P&gt;2. As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;writes this doesn't look like a good application for the SAS data step hash object so why would you want to go for such an approach in first place - unless that's an exercise.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 02:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/case-when-when-applying-in-hash-object/m-p/618743#M19270</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-01-21T02:42:55Z</dc:date>
    </item>
  </channel>
</rss>

