<?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: i have 1000 variable i want to keep 500 variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752589#M237101</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i have 10000 variable and i want to keep only 500 variable.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;without using keep drop&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;WHY?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only other method I can think of is to explicitly name each of your columns in a SELECT statement in SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A real kludgy method is create a separate data set with the desired named variables of the proper types and use Proc Append with Force. Not that I advocate such, but it is a way that meets OP somewhat problematic requirement. Probably way more work than proper variable lists with drop and keep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt; could share a proc contents with Order=Varnum output and indicate which variables he wants.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jul 2021 14:21:30 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-07-07T14:21:30Z</dc:date>
    <item>
      <title>i have 1000 variable i want to keep 500 variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752096#M236857</link>
      <description>&lt;P&gt;i have 10000 variable and i want to keep only 500 variable.&lt;/P&gt;
&lt;P&gt;without using keep drop&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 14:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752096#M236857</guid>
      <dc:creator>aanan1417</dc:creator>
      <dc:date>2021-07-05T14:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: i have 1000 variable i want to keep 500 variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752099#M236858</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i have 10000 variable and i want to keep only 500 variable.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;without using keep drop&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;WHY?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only other method I can think of is to explicitly name each of your columns in a SELECT statement in SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select name, age 
from sashelp.class;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have naming conventions or patterns you can generate your variable lists dynamically or use variable short cut lists but those cannot be used in SQL.&lt;/P&gt;
&lt;P&gt;Here is a reference that illustrates how to refer to variables and datasets in a short cut list:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 15:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752099#M236858</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-05T15:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: i have 1000 variable i want to keep 500 variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752110#M236863</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To help you, we will need more information, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Are the variables on a SAS data set, or a csv, or some other file?&lt;/LI&gt;
&lt;LI&gt;Where do you want to output the data to, e.g., a csv file?&lt;/LI&gt;
&lt;LI&gt;What code have you tried so far? Please share any error messages and related code from the log.&lt;/LI&gt;
&lt;LI&gt;What is the reason why you cannot use keep or drop?&lt;/LI&gt;
&lt;LI&gt;Do you have any other special requirements?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: If you have a SAS data you could write it out to a file (e.g., proc export) and just read in the information you want from that file, but again the requirement to not use drop or keep, means there is more code (and I/O in this case) than is necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 15:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752110#M236863</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2021-07-05T15:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: i have 1000 variable i want to keep 500 variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752589#M237101</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i have 10000 variable and i want to keep only 500 variable.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;without using keep drop&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;WHY?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only other method I can think of is to explicitly name each of your columns in a SELECT statement in SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A real kludgy method is create a separate data set with the desired named variables of the proper types and use Proc Append with Force. Not that I advocate such, but it is a way that meets OP somewhat problematic requirement. Probably way more work than proper variable lists with drop and keep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt; could share a proc contents with Order=Varnum output and indicate which variables he wants.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 14:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/i-have-1000-variable-i-want-to-keep-500-variable/m-p/752589#M237101</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-07T14:21:30Z</dc:date>
    </item>
  </channel>
</rss>

