<?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: Dropping a variable from a SAS dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477199#M286202</link>
    <description>&lt;P&gt;There are several way and depends on how you want it. You can use DROP= if you have only few variables to drop or KEEP= if there are more variables to drop and only few to keep.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are some way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Reads from the input, but doesn't output */
data class (drop=Name);
set sashelp.class;
run;

/* Doesn't read from the input, so it will not be in output */
data class ;
set sashelp.class(drop=Name);
run;

/* You can also use drop in Proc SQL */
proc sql;
create table class(drop=Name) as
select *
	from sashelp.class;
quit;
/* Similar to above */
proc sql;
create table class as
select Sex,Age,Height,Weight /* Name variable is dropped */
	from sashelp.class;
quit;

/* You Can also alter table */
proc sql;
create table class as
select *
	from sashelp.class;
quit;
proc sql;
alter table work.class
drop name;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Jul 2018 18:49:42 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2018-07-11T18:49:42Z</dc:date>
    <item>
      <title>Dropping a variable from a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477195#M286200</link>
      <description>&lt;P&gt;How do I drop a variable from a SAS dataset?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477195#M286200</guid>
      <dc:creator>JohnSAScom</dc:creator>
      <dc:date>2018-07-11T18:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dropping a variable from a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477198#M286201</link>
      <description>&lt;P&gt;Use the drop statement or the drop dataset option. Documentation can be found by searching for "sas drop variable" on google.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477198#M286201</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-11T18:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dropping a variable from a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477199#M286202</link>
      <description>&lt;P&gt;There are several way and depends on how you want it. You can use DROP= if you have only few variables to drop or KEEP= if there are more variables to drop and only few to keep.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are some way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Reads from the input, but doesn't output */
data class (drop=Name);
set sashelp.class;
run;

/* Doesn't read from the input, so it will not be in output */
data class ;
set sashelp.class(drop=Name);
run;

/* You can also use drop in Proc SQL */
proc sql;
create table class(drop=Name) as
select *
	from sashelp.class;
quit;
/* Similar to above */
proc sql;
create table class as
select Sex,Age,Height,Weight /* Name variable is dropped */
	from sashelp.class;
quit;

/* You Can also alter table */
proc sql;
create table class as
select *
	from sashelp.class;
quit;
proc sql;
alter table work.class
drop name;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477199#M286202</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-07-11T18:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dropping a variable from a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477209#M286203</link>
      <description>&lt;P&gt;Thanks Kurt.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477209#M286203</guid>
      <dc:creator>JohnSAScom</dc:creator>
      <dc:date>2018-07-11T19:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dropping a variable from a SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477210#M286204</link>
      <description>&lt;P&gt;Thanks Surya.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-a-variable-from-a-SAS-dataset/m-p/477210#M286204</guid>
      <dc:creator>JohnSAScom</dc:creator>
      <dc:date>2018-07-11T19:17:08Z</dc:date>
    </item>
  </channel>
</rss>

