<?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: Delete a shared variable in multiple data sets in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517875#M3443</link>
    <description>&lt;P&gt;read all of the directory dataset members into a file.&lt;/P&gt;
&lt;P&gt;use that file to call each of the datasets in datastep and include&amp;nbsp; drop statement that would drop group in the output dataset.&lt;/P&gt;</description>
    <pubDate>Sun, 02 Dec 2018 16:37:24 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2018-12-02T16:37:24Z</dc:date>
    <item>
      <title>Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517869#M3439</link>
      <description>&lt;P&gt;Hello. I have 100 sas data sets (they are in the same folder) and all of them have a same variable called group. Is there any efficient way to delete this variable from all these data sets rather than deleting them one file by one file? Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517869#M3439</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2018-12-02T16:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517873#M3442</link>
      <description>&lt;P&gt;You could write a macro to do this across all datasets in a libname (folder).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could use CALL EXECUTE to do the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose that would be "efficient" compared to doing it one-by-one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not at work and don't have SAS available to test any code right now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But let me ask a very basic question: why do you need to delete this variable anyway? It isn't hurting anything if you keep it in there, the data sets are a little larger but other than that it doesn't matter. It could be that the simplest thing to do is to change your mindset and leave the variable in there.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517873#M3442</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-02T16:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517875#M3443</link>
      <description>&lt;P&gt;read all of the directory dataset members into a file.&lt;/P&gt;
&lt;P&gt;use that file to call each of the datasets in datastep and include&amp;nbsp; drop statement that would drop group in the output dataset.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517875#M3443</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-12-02T16:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517876#M3444</link>
      <description>&lt;P&gt;Thanks for your advice. I am going to use a supercomputer to run these datasets and the space in supercomputer is limited so I would like to delete it. Moreover, I will give each observation a new number when I run datasets in supercomputer.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517876#M3444</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2018-12-02T16:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517877#M3445</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122002"&gt;@VDD&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;read all of the directory dataset members into a file.&lt;/P&gt;
&lt;P&gt;use that file to call each of the datasets in datastep and include&amp;nbsp; drop statement that would drop group in the output dataset.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'd like to recommend that instead of using a data step to do this (which causes SAS to read every record and could be slow if the datasets are large), that you use PROC DATASETS to delete the variable.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:43:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517877#M3445</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-02T16:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517879#M3447</link>
      <description>&lt;P&gt;Thanks. I will look up that code.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517879#M3447</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2018-12-02T16:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517880#M3448</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;Moreover, I will give each observation a new number when I run datasets in supercomputer.&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm afraid I don't understand this. It does not fit with the rest of the topic.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517880#M3448</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-02T16:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517881#M3449</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202889"&gt;@dapenDaniel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for your advice. I am going to use a supercomputer to run these datasets and the space in supercomputer is limited so I would like to delete it. Moreover, I will give each observation a new number when I run datasets in supercomputer.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just don't pass the variable over.&amp;nbsp; How are you moving the SAS datasets to the SuperComputer?&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:53:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517881#M3449</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-12-02T16:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517882#M3450</link>
      <description>&lt;P&gt;I can remotely access to the supercomputer.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 16:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517882#M3450</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2018-12-02T16:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517883#M3451</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202889"&gt;@dapenDaniel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I can remotely access to the supercomputer.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would assume so. They probably keep the room where the computer is very cold.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you running SAS on the supercomputer?&amp;nbsp; If not then what? Some type of database? Some other language?&lt;/P&gt;
&lt;P&gt;Are you connecting to the supercomputer using a SAS program running on your normal computer?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are you MOVING the data files to the supercomputer?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the files are already on the supercomputer than just tell it to ignore that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are the files actual SAS datasets or some other format, like delimited text files?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example if your supercomputer is running SAS and your data sets are actual SAS datasets then use the DROP= dataset option.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 17:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517883#M3451</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-12-02T17:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517884#M3452</link>
      <description>&lt;P&gt;If it is a supper computer or a server, are you sure that other process's or user are not using the variable you are wanting to drop?&lt;/P&gt;
&lt;P&gt;Don't create issues for yourself or others just by dropping a stuff.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 17:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/517884#M3452</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-12-02T17:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Delete a shared variable in multiple data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/518040#M3480</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
 set sashelp.class;
 id=1;
run;
data b;
 set sashelp.air;
 id=1;
run;






proc contents data=work._all_ out=temp varnum noprint;
run;
proc sql noprint;
select  name into : list separated by ','
 from temp
  group by name
   having count(*)&amp;gt;1;

create table want as
select  distinct memname
 from temp
  group by name
   having count(*)&amp;gt;1;
quit;
data _null_;
 set want end=last;
 if _n_=1 then call execute('proc sql; ');
 call execute(cat('alter table ',memname,''));
 call execute(cat('drop ',"&amp;amp;list",';'));
 if last then call execute(';quit;');
run;



&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2018 13:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-a-shared-variable-in-multiple-data-sets/m-p/518040#M3480</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-12-03T13:49:52Z</dc:date>
    </item>
  </channel>
</rss>

