<?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: pick 0 and 1 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199159#M49762</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;stat@sas 's solution is on the right track, the reason being, I have to say, is you switched your original requirements on the course. A small tweak on stat@sas 's code will work for you, mind you to give a try. The following is equivalent, but it takes more to understand:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *, (-1)**(sum(val = 0)&amp;gt;0)*val as val1 from have&lt;/P&gt;&lt;P&gt;group by id,grp1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jul 2015 01:28:46 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2015-07-09T01:28:46Z</dc:date>
    <item>
      <title>pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199153#M49756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have following have dataset, where i need to do is if i have same grp with 0 &amp;amp; 1 , pick that grp need to assign val variable is - to 1 (-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the below example 100 xxx, 100 aaa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id grp1 $ val $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp;&amp;nbsp;&amp;nbsp; .33&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp;&amp;nbsp;&amp;nbsp; .67&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp;&amp;nbsp;&amp;nbsp; .5&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp;&amp;nbsp;&amp;nbsp; .5&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input id grp1 $ val;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp; -1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp;&amp;nbsp;&amp;nbsp; .33&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp;&amp;nbsp;&amp;nbsp; .67&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp;&amp;nbsp;&amp;nbsp; .5&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp;&amp;nbsp;&amp;nbsp; .5&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp;&amp;nbsp; -1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2015 22:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199153#M49756</guid>
      <dc:creator>sam369</dc:creator>
      <dc:date>2015-07-08T22:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199154#M49757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;by id grp1 descending val;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; merge have have(firstobs=2 rename=(id=_id grp1=_grp1 val=_val));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if id=_id and grp1=_grp1 and val in (0,1) and _val in (0,1) then val=-val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; drop _:;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2015 22:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199154#M49757</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-07-08T22:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199155#M49758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *,case when sum(val in (1,0))&amp;gt;1 and val=1 then val*-1 else val end as val1 from have&lt;/P&gt;&lt;P&gt;group by id,grp1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2015 23:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199155#M49758</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-07-08T23:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199156#M49759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank ,it worked for my sample data, but i have a another grp which i missed. Not only 0 &amp;amp; 1 if any of the grp have val 0 then the need to assign another val value to negative too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the below case , xxx, aaaa, bbbb, cccc val values should be -val&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id grp1 $ val $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp;&amp;nbsp;&amp;nbsp; .33&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp;&amp;nbsp;&amp;nbsp; .67&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp;&amp;nbsp;&amp;nbsp; .5&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp;&amp;nbsp;&amp;nbsp; .5&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp;&amp;nbsp; 0.63&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp;&amp;nbsp;&amp;nbsp; .4&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; dddd&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; dddd&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; eeee&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp; eeee&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input id grp1 $ val;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp; -1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp;&amp;nbsp;&amp;nbsp; .33&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp;&amp;nbsp;&amp;nbsp; .67&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp;&amp;nbsp;&amp;nbsp; .5&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp;&amp;nbsp;&amp;nbsp; .5&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp;&amp;nbsp; -1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp;&amp;nbsp; -0.63&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp;&amp;nbsp;&amp;nbsp; -.40&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; dddd&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; dddd&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp; eeee&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;100&amp;nbsp; eeee&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: peda sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2015 23:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199156#M49759</guid>
      <dc:creator>sam369</dc:creator>
      <dc:date>2015-07-08T23:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199157#M49760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A small modification in the above code &lt;SPAN style="font-size: 13.3333330154419px;"&gt;should &lt;/SPAN&gt;produce the desired results. Please try this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *,case when sum(val in (1,0))&lt;STRONG&gt;&amp;gt;=1&lt;/STRONG&gt; then val*-1 else val end as val1 from have&lt;/P&gt;&lt;P&gt;group by id,grp1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 00:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199157#M49760</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-07-09T00:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199158#M49761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you so much for your quick response. i have added one more to have group according to my real data&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; id grp1 $ trt $ val ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp; x&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp; y&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp; x&amp;nbsp; .33&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp; y&amp;nbsp; .67&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp; x&amp;nbsp; .5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp; y&amp;nbsp; .5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp; x 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp; y 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp; x 0.63&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp; y 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp; x&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp;&amp;nbsp; y .4&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; dddd&amp;nbsp; x&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; dddd&amp;nbsp; y&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; eeee&amp;nbsp; x&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp; eeee&amp;nbsp;&amp;nbsp; y&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp; ffff&amp;nbsp;&amp;nbsp; x&amp;nbsp; .67&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp; ffff&amp;nbsp;&amp;nbsp; y&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; *,case &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; sum(val &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;))&amp;gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &amp;amp; sum(val) ne &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; val*-&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; val end &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; val1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; id,grp1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;output:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;IMG alt="" class="jiveImage" src="https://communities.sas.com/legacyfs/online/11119_pastedImage_2.png" style="width: 357px; height: 323px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;want1:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp; grp1 trt&amp;nbsp; val&amp;nbsp; val1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp; x&amp;nbsp; 0&amp;nbsp; 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp; y&amp;nbsp; 1&amp;nbsp; -1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp; x&amp;nbsp; .33 .33&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; yyyy&amp;nbsp; y&amp;nbsp; .67 .67&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp; x&amp;nbsp; .5&amp;nbsp;&amp;nbsp; .5&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; zzzz&amp;nbsp; y&amp;nbsp; .5&amp;nbsp;&amp;nbsp; .5&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp; x 1&amp;nbsp;&amp;nbsp;&amp;nbsp; -1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp; y 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp; x 0.63&amp;nbsp; -.63&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp; y 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp; x&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp;&amp;nbsp; y .4&amp;nbsp; -.4&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; dddd&amp;nbsp; x&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; dddd&amp;nbsp; y&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; eeee&amp;nbsp; x&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp; eeee&amp;nbsp;&amp;nbsp; y&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp; ffff&amp;nbsp;&amp;nbsp; x&amp;nbsp; .67&amp;nbsp; .67&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp; ffff&amp;nbsp;&amp;nbsp; y&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there any way to pick only values having 0 &amp;amp; (any value) for individual grp&lt;/P&gt;&lt;P&gt;i mean another dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;want2:&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp; x&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp; y&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp; x 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; aaaa&amp;nbsp; y 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp; x 0.63&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; bbbb&amp;nbsp; y 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp; x&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100&amp;nbsp;&amp;nbsp; cccc&amp;nbsp;&amp;nbsp; y .4&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Sam&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 00:55:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199158#M49761</guid>
      <dc:creator>sam369</dc:creator>
      <dc:date>2015-07-09T00:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199159#M49762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;stat@sas 's solution is on the right track, the reason being, I have to say, is you switched your original requirements on the course. A small tweak on stat@sas 's code will work for you, mind you to give a try. The following is equivalent, but it takes more to understand:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *, (-1)**(sum(val = 0)&amp;gt;0)*val as val1 from have&lt;/P&gt;&lt;P&gt;group by id,grp1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 01:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199159#M49762</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-07-09T01:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199160#M49763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Hai.kuo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much It worked!!!!&lt;/P&gt;&lt;P&gt;could you please explain in detail the below part... i am not aware of **&lt;/P&gt;&lt;P&gt;"(-1)**(sum(val = 0)&amp;gt;0)*val"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 01:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199160#M49763</guid>
      <dc:creator>sam369</dc:creator>
      <dc:date>2015-07-09T01:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199161#M49764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if there is a (val=0) in the group, then sum(val=0) should great than 0, the Boolean value of (sum(val=0) &amp;gt;0) is 1 (true statement). we put (sum(val=0) &amp;gt;0) as the power of (-1), this is reflect a conditional choice, when there is (val=0) in the group, then (-1) **1= -1, val gets to flip sign, if not, (-1) ** 0 =1, val gets to stay the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you go back to the code by stat@sas, it only takes the following tweak to do the same thing, and is a lot easier to understand:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy; background-position: initial;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy; background-position: initial;"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt; want &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt; *,case &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt; sum(val = &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: teal; background-position: initial;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt;)&amp;gt;=&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: teal; background-position: initial;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt; val*-&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: teal; background-position: initial;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;else &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt;val end &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt; val1 &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt; have&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue; background-position: initial;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt; id,grp1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy; background-position: initial;"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 01:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199161#M49764</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-07-09T01:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: pick 0 and 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199162#M49765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your time &amp;amp; detail explanation Hai.kuo.&lt;/P&gt;&lt;P&gt;Now i understood clearly!!!!! new thing to learn ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great night&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sam&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 01:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pick-0-and-1/m-p/199162#M49765</guid>
      <dc:creator>sam369</dc:creator>
      <dc:date>2015-07-09T01:57:53Z</dc:date>
    </item>
  </channel>
</rss>

