<?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: use of VNAME to drop variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515469#M139080</link>
    <description>Don’t use arrays then. &lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/text_analysis" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/text_analysis&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you do want it wide</description>
    <pubDate>Fri, 23 Nov 2018 01:17:01 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-11-23T01:17:01Z</dc:date>
    <item>
      <title>use of VNAME to drop variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515454#M139074</link>
      <description>&lt;P&gt;I have parsed every sentence to its words.&lt;/P&gt;
&lt;P&gt;I use an array for this task, I overestimate the number of elements necessary.&lt;/P&gt;
&lt;P&gt;Once done I want to drop those overhanging variables created by the array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know how to address this problems in many ways like building a macro variable via proc sql or symputx and use it in the drop statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but all ideas require at least one more data step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so I thought why not use the vname function to feed the drop statement at the end.&lt;/P&gt;
&lt;P&gt;But it doesn't work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.test3;
set WORK.test2 end=eof;
where bastidor ne "";
array parsed_txt(100) $200;
retain maxi;
i=1;
do while(scan(texto, i, " ") ne "");
parsed_txt(i) = strip(scan(texto, i, " "));
i+1;
maxi=max(i,maxi);
end;

if eof then do;
do j=maxi to 100;
temp= vname(parsed_opt(j));
drop parsed_opt1;
end;
end;
drop i maxi;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Nov 2018 22:54:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515454#M139074</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2018-11-22T22:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: use of VNAME to drop variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515460#M139079</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Statements like DROP KEEP RENAME LENGTH FORMAT etc. - are declarations in a data step&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; not executable through run. ( I hope&amp;nbsp;my English is clear enough).&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;While running data step sas writes all variables to output according to declarative statements.&lt;/P&gt;
&lt;P&gt;You can't drop variables after they have been already written to output but in a separate step by&lt;/P&gt;
&lt;P&gt;copying data and keep selected variables only, defined by KEEP, DROP or RENAME satements.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 00:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515460#M139079</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-11-23T00:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: use of VNAME to drop variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515469#M139080</link>
      <description>Don’t use arrays then. &lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/text_analysis" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/text_analysis&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you do want it wide</description>
      <pubDate>Fri, 23 Nov 2018 01:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515469#M139080</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-23T01:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: use of VNAME to drop variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515474#M139081</link>
      <description>If you want a wide dataset at the end, add a proc transpose, but IME it’s easier to work with it in the long form.</description>
      <pubDate>Fri, 23 Nov 2018 04:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515474#M139081</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-23T04:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: use of VNAME to drop variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515492#M139088</link>
      <description>&lt;P&gt;I took the data to long format afterward and I achieve what I planned to (reading this data set into IML and run a SVD, filter for the 10 most relevant eigenvalues and its dominant members in the V matrix where the words come into play(.&lt;/P&gt;
&lt;P&gt;But often I have the feeling that I could have solved a given theme in a more efficient manner. Your link to the sentence-to-words code is fine. I thought that I could use VNAME for this purpose in runtime.&lt;/P&gt;
&lt;P&gt;I haven't discovered yet the usefulness of VNAME or VVALUEX functions...&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 06:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515492#M139088</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2018-11-23T06:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: use of VNAME to drop variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515515#M139098</link>
      <description>&lt;P&gt;Thanks, if I write out the overhanging and empty variables explicitly after the drop statement, the code works and the result is what I want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it seems that I cannot hand over to the drop statement a concatenated string that once resolved is a variable name and therefore should be interpreted like this by the drop statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 10:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-VNAME-to-drop-variables/m-p/515515#M139098</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2018-11-23T10:02:19Z</dc:date>
    </item>
  </channel>
</rss>

