<?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: subsetting in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316130#M9052</link>
    <description>&lt;P&gt;It is insterting problem, what I understand you want to control the column in output dataset based on the value in the table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In below example, I tried to keep only column Type when Make='Audi'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars ;
set sashelp.cars(obs=10);
run;

%macro control_column(cond=,keep_list=);
data cars_new;
set cars;
where &amp;amp;cond;
keep &amp;amp;keep_list;
run;
%mend;

%control_column(cond=Make='Audi', keep_list=Type);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 02 Dec 2016 03:07:33 GMT</pubDate>
    <dc:creator>RahulG</dc:creator>
    <dc:date>2016-12-02T03:07:33Z</dc:date>
    <item>
      <title>subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316127#M9051</link>
      <description>&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csCF6BBF71"&gt;&amp;nbsp;I have a dataset as below. I want to keep the value based on the “studyeye”. For example, if it is OD in “studyeye", I keep only the value from “PrevIOP_OD_1". How can I do that in SAS studio?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csCF6BBF71"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13217iD9672F958072EA10/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screen Shot 2016-12-01 at 2.25.23 PM.png" title="Screen Shot 2016-12-01 at 2.25.23 PM.png" /&gt;</description>
      <pubDate>Fri, 02 Dec 2016 02:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316127#M9051</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2016-12-02T02:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316130#M9052</link>
      <description>&lt;P&gt;It is insterting problem, what I understand you want to control the column in output dataset based on the value in the table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In below example, I tried to keep only column Type when Make='Audi'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars ;
set sashelp.cars(obs=10);
run;

%macro control_column(cond=,keep_list=);
data cars_new;
set cars;
where &amp;amp;cond;
keep &amp;amp;keep_list;
run;
%mend;

%control_column(cond=Make='Audi', keep_list=Type);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Dec 2016 03:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316130#M9052</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-12-02T03:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316132#M9053</link>
      <description>&lt;P&gt;Thank you Rahul. Do you keep the whole column or just some values in the column? I want to keep only some value of the column. Could you upload part of the dataset?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 03:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316132#M9053</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2016-12-02T03:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316133#M9054</link>
      <description>&lt;P&gt;You can execute the above code in SAS studio and see if you are getting desired result.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 03:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316133#M9054</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-12-02T03:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316146#M9056</link>
      <description>&lt;P&gt;Based on your data what would you expect as your output?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 05:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316146#M9056</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-02T05:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316267#M9068</link>
      <description>&lt;P&gt;I want to have only the PrevIOPOD_1/PrevIOPOS_1 values based on the studyeye.&lt;/P&gt;&lt;P&gt;I come up with a maybe easier solution. I can split the dataset based on the sutdyeye into two subdatasets. Then I can keep one of the PrevIOPOS_1/&lt;SPAN&gt;PrevIOPOS_1. then I combine them again.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 14:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316267#M9068</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2016-12-02T14:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316298#M9071</link>
      <description>&lt;P&gt;Write a PROC SQL and&amp;nbsp;WHERE using a subquery on the dataset doing a count(*) as count&amp;nbsp;on each scenario, where count&amp;nbsp;&amp;gt;=10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 16:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316298#M9071</guid>
      <dc:creator>David_Luttrell</dc:creator>
      <dc:date>2016-12-02T16:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316559#M9083</link>
      <description>&lt;P&gt;You have shown us the source table.&amp;nbsp;&amp;nbsp; Now&amp;nbsp;show us explicitly what the result table would look like.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2016 12:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316559#M9083</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2016-12-04T12:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316759#M9095</link>
      <description>&lt;P&gt;&lt;SPAN class="login-bold"&gt;Hi, I hope the table output shown as the attached, keeping only values depending on "studyeye". Many thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13227i4B57A92ECAEFE61C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screen Shot 2016-12-05 at 11.19.15 AM.png" title="Screen Shot 2016-12-05 at 11.19.15 AM.png" /&gt;</description>
      <pubDate>Mon, 05 Dec 2016 16:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/subsetting/m-p/316759#M9095</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2016-12-05T16:21:11Z</dc:date>
    </item>
  </channel>
</rss>

