<?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: Delete variables from cell in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503904#M882</link>
    <description>&lt;P&gt;Repeating , ok. How many repeating or is it just 2 like in your sample? Which record within a by group&amp;nbsp; do you want to keep(some logic for that) plz?&lt;/P&gt;</description>
    <pubDate>Fri, 12 Oct 2018 20:59:58 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-10-12T20:59:58Z</dc:date>
    <item>
      <title>Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503898#M880</link>
      <description>&lt;P&gt;I have a data set were few variables are repeating but i only want to keep info for a specific variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name&amp;nbsp; &amp;nbsp; &amp;nbsp; ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Code&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;code_description&amp;nbsp; &amp;nbsp; type&lt;/P&gt;&lt;P&gt;Sarah&amp;nbsp; &amp;nbsp; &amp;nbsp; 0007&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DM test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mining&lt;/P&gt;&lt;P&gt;Sarah&amp;nbsp; &amp;nbsp; &amp;nbsp; 0007&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DM test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;list&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jack&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F56&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HPY type 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mining&lt;/P&gt;&lt;P&gt;Jack&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; H78&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;HPY type 1&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; list&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name&amp;nbsp; &amp;nbsp; &amp;nbsp; ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Code&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;code_description&amp;nbsp; &amp;nbsp; type&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DM test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mining&lt;/P&gt;&lt;P&gt;Sarah&amp;nbsp; &amp;nbsp; &amp;nbsp; 0007&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DM test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;list&amp;nbsp;&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; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;F56&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HPY type 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mining&lt;/P&gt;&lt;P&gt;Jack&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;H78&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;HPY type 1&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; list&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so i want to delete the name and ID or just place a zero or none&amp;nbsp; for mining when that data is repeated like this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 20:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503898#M880</guid>
      <dc:creator>hk2013</dc:creator>
      <dc:date>2018-10-12T20:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503904#M882</link>
      <description>&lt;P&gt;Repeating , ok. How many repeating or is it just 2 like in your sample? Which record within a by group&amp;nbsp; do you want to keep(some logic for that) plz?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 20:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503904#M882</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-12T20:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503910#M885</link>
      <description>its will always be just 2 repeat instances like the sample. I want to keep the info for the 'list' type only and remove info for the 'mining' type</description>
      <pubDate>Fri, 12 Oct 2018 21:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503910#M885</guid>
      <dc:creator>hk2013</dc:creator>
      <dc:date>2018-10-12T21:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503912#M886</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Name   $   ID      $     Code  $     code_description  &amp;amp; $15.  type $;
cards;
Sarah      0007       A19            DM test                mining
Sarah      0007       B45            DM test                 list 
Jack        1111        F56            HPY type 1            mining
Jack        1111        H78            HPY type 1            list 
;


data want;
set have;
if type='mining' then call missing(name,id);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
set have;
if type ne 'list' then call missing(name,id);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 21:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503912#M886</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-12T21:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503915#M888</link>
      <description>&lt;P&gt;thank you replying but i have other 'mining' type data in my set and they dont have 'list' type repeating for them so when that happens i want to keep the info as it is&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 21:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503915#M888</guid>
      <dc:creator>hk2013</dc:creator>
      <dc:date>2018-10-12T21:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503918#M889</link>
      <description>&lt;P&gt;Does that mean those others have just 1 record for an id? or is it 2 records both with type='mining' ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you modify the sample&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 21:28:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503918#M889</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-12T21:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503921#M890</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Name   $   ID      $     Code  $     code_description  &amp;amp; $15.  type $;
cards;
Sarah      0007       A19            DM test                mining
Sarah      0007       B45            DM test                 list 
Jack        1111        F56            HPY type 1            mining
Jack        1111        H78            HPY type 1            list 
Bob         1222       F56             HPY type 1            mining
Rob         3333       A19            DM test                  mining
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;so some ids only have mining type but i dont wwant to remove their info. I only want to remover mining info if they have list type and mining type&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 21:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503921#M890</guid>
      <dc:creator>hk2013</dc:creator>
      <dc:date>2018-10-12T21:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503923#M891</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Name   $   ID      $     Code  $     code_description  &amp;amp; $15.  type $;
cards;
Sarah      0007       A19            DM test                mining
Sarah      0007       B45            DM test                 list 
Jack        1111        F56            HPY type 1            mining
Jack        1111        H78            HPY type 1            list 
Bob         1222       F56             HPY type 1            mining
Rob         3333       A19            DM test                  mining
;
proc sort data=have;
by id;
run;
data want;
call missing(f);
do until(last.id);
set have;
by id;
if type='list' then f=1;
end;
do until(last.id);
set have;
by id;
if f and type='mining' then call missing(name,id);
output;
end;
drop f;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Oct 2018 21:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503923#M891</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-12T21:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503954#M895</link>
      <description>Would it make sense to collapse the data, one record per person, with two columns for mining/list.</description>
      <pubDate>Fri, 12 Oct 2018 23:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/503954#M895</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-12T23:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Delete variables from cell</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/504037#M909</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like that you have multiple observations per NAME,ID group and when that happens you want to remove the NAME and ID values from the observations that has TYPE='mining' and keep them for the observations that have TYPE='list'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This sounds like a bad idea.&amp;nbsp; What is the reason you want to do this?&amp;nbsp; Perhaps you are just trying to produce a report?&lt;/P&gt;
&lt;P&gt;If so then perhaps it is better to leave the values in place and use a reporting method that display the id variables just once per group?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input Name $ ID $ Code $ code_description &amp;amp;:$15. type $ ;
cards;
Sarah  0007 A19 DM test     mining
Sarah  0007 B45 DM test     list 
Jack   1111 F56 HPY type 1  mining
Jack   1111 H78 HPY type 1  list
;

proc sort; by Name ID type ; run;
proc print ;
  by Name Id;
  id Name Id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;                            code_
Name      ID     Code    description     type

Jack     1111    H78     HPY type 1     list
                 F56     HPY type 1     mining


Sarah    0007    B45     DM test        list
                 A19     DM test        mining
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 19:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-variables-from-cell/m-p/504037#M909</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-13T19:38:21Z</dc:date>
    </item>
  </channel>
</rss>

