<?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: Working on the SAS variable name only in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Working-on-the-SAS-variable-name-only/m-p/18772#M3729</link>
    <description>Examine the sashelp.vcolumn view. It contains everything you need to create a drop-statement for proc sql.&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
  select name&lt;BR /&gt;
  into :kill_list separated by ','&lt;BR /&gt;
  from sashelp.vcolumn&lt;BR /&gt;
  where memname = upcase('NAME_OF_YOUR_DATASET') and index(upcase(name), 'VO') &amp;gt; 0; &lt;BR /&gt;
&lt;BR /&gt;
  alter table NAME_OF_YOUR_DATASET&lt;BR /&gt;
    drop &amp;amp;kill_list;&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Untested.</description>
    <pubDate>Wed, 15 Apr 2009 07:06:09 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2009-04-15T07:06:09Z</dc:date>
    <item>
      <title>Working on the SAS variable name only</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-on-the-SAS-variable-name-only/m-p/18771#M3728</link>
      <description>Is there anyone know how to perform the data manipulation on the SAS variable name only?&lt;BR /&gt;
&lt;BR /&gt;
So far, every time the performance that referred to a variable is on its data below the variable name. But wot if I only want to use that variable name for my purpose? ie. &lt;BR /&gt;
&lt;BR /&gt;
TWO TWOVO  TLE    TLEVO  TLC  TLCVO   &lt;BR /&gt;
1          1&lt;BR /&gt;
3         3&lt;BR /&gt;
4         5  &lt;BR /&gt;
5           6&lt;BR /&gt;
&lt;BR /&gt;
I want to delete the variable name contains 'VO', how can I do it?&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 15 Apr 2009 06:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-on-the-SAS-variable-name-only/m-p/18771#M3728</guid>
      <dc:creator>Fred_Gavin</dc:creator>
      <dc:date>2009-04-15T06:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Working on the SAS variable name only</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-on-the-SAS-variable-name-only/m-p/18772#M3729</link>
      <description>Examine the sashelp.vcolumn view. It contains everything you need to create a drop-statement for proc sql.&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
  select name&lt;BR /&gt;
  into :kill_list separated by ','&lt;BR /&gt;
  from sashelp.vcolumn&lt;BR /&gt;
  where memname = upcase('NAME_OF_YOUR_DATASET') and index(upcase(name), 'VO') &amp;gt; 0; &lt;BR /&gt;
&lt;BR /&gt;
  alter table NAME_OF_YOUR_DATASET&lt;BR /&gt;
    drop &amp;amp;kill_list;&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Untested.</description>
      <pubDate>Wed, 15 Apr 2009 07:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-on-the-SAS-variable-name-only/m-p/18772#M3729</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2009-04-15T07:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Working on the SAS variable name only</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-on-the-SAS-variable-name-only/m-p/18773#M3730</link>
      <description>Hello Fred.&lt;BR /&gt;
&lt;BR /&gt;
You could access to the metadata of the the table (say with proc contents or dictionary.columns), build a macro variable with the list of the desired columns and then perform a DROP of those (always rewriting the dataset).&lt;BR /&gt;
&lt;BR /&gt;
/* get table info */&lt;BR /&gt;
proc contents data = YOURDATA out = _CONTENTS noprint;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
/* buil DROPLIST */&lt;BR /&gt;
%let DROPLIST=;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set _CONTENTS;&lt;BR /&gt;
where index(upcase(NAME),'VO'); /* Var names who contains 'VO' */&lt;BR /&gt;
call symput('DROPLIST',catx(' ',symget('DROPLIST'),NAME));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
/* rewrite the dataset and drop the desired Vars */&lt;BR /&gt;
%put &amp;amp;DROPLIST;&lt;BR /&gt;
data YOURDATA;&lt;BR /&gt;
set YOURDATA;&lt;BR /&gt;
drop &amp;amp;DROPLIST;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Greetings from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos at &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Wed, 15 Apr 2009 07:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-on-the-SAS-variable-name-only/m-p/18773#M3730</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-04-15T07:09:15Z</dc:date>
    </item>
  </channel>
</rss>

