<?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: PROC export  with a KEEP statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61243#M17375</link>
    <description>Here is the failed code:&lt;BR /&gt;
&lt;BR /&gt;
proc export data=astu_efa_sort (where=(schnum='006'))&lt;BR /&gt;
(keep=schnum permnum_s last_s first_s middle_s grade_s efaprim engprof_s advisor_s ela_sort math_sort science_sort social_sort)	&lt;BR /&gt;
outfile='G:\Departments\Research\TESTING\PASS\2010\TestingRosters\prelim_roster.xls'&lt;BR /&gt;
dbms=excel&lt;BR /&gt;
replace;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 22 Feb 2010 20:57:05 GMT</pubDate>
    <dc:creator>GreggB</dc:creator>
    <dc:date>2010-02-22T20:57:05Z</dc:date>
    <item>
      <title>PROC export  with a KEEP statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61238#M17370</link>
      <description>Can I make this code work somehow?  The starred out keep option doesn't work but I want it to.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  I could create a another data step with just these variables but am always looking for more efficient means of doing things.&lt;BR /&gt;
&lt;BR /&gt;
proc export data=astu_efa_sort  /*(keep=(schnum permnum_s last_s first_s middle_s grade_s efaprim engprof_s advisor_s ela_sort math_sort science_sort social_sort))*/&lt;BR /&gt;
outfile='G:\Departments\Research\TESTING\PASS\2009\TestingRosters\prelim_roster'   dbms=excel    replace;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 22 Feb 2010 19:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61238#M17370</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2010-02-22T19:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC export  with a KEEP statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61239#M17371</link>
      <description>With PROC EXPORT the best you can do is to create a VIEW with the subset of variables you want.  Should be efficient enough.</description>
      <pubDate>Mon, 22 Feb 2010 20:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61239#M17371</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-02-22T20:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC export  with a KEEP statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61240#M17372</link>
      <description>I have no problems getting proc export to work with a keep statement in SAS 9.2.&lt;BR /&gt;
&lt;BR /&gt;
your syntax is wrong, there is no parenthesis after keep=, and thus you would also only need a single parenthesis at the end of the keep list</description>
      <pubDate>Mon, 22 Feb 2010 20:11:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61240#M17372</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2010-02-22T20:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: PROC export  with a KEEP statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61241#M17373</link>
      <description>Thanks.  When I removed a set of ( ), it worked, BUT I had to star out the WHERE statement.  Should I not be able to to get the WHERE and KEEP statement to work?&lt;BR /&gt;
&lt;BR /&gt;
option spool;&lt;BR /&gt;
proc export data=astu_efa_sort /*(where=(schnum='006'))*/&lt;BR /&gt;
&lt;BR /&gt;
(keep=schnum permnum_s last_s first_s middle_s grade_s efaprim engprof_s advisor_s ela_sort math_sort science_sort social_sort)&lt;BR /&gt;
&lt;BR /&gt;
outfile='G:\Departments\Research\TESTING\PASS\2010\TestingRosters\prelim_roster.xls'&lt;BR /&gt;
dbms=excel&lt;BR /&gt;
replace;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 22 Feb 2010 20:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61241#M17373</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2010-02-22T20:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC export  with a KEEP statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61242#M17374</link>
      <description>Are you putting the where and keep inside of one parenthesis or two? ie.&lt;BR /&gt;
(where=(schnum='006') keep=schnum permnum_s last_s first_s middle_s grade_s efaprim engprof_s advisor_s ela_sort math_sort science_sort social_sort)&lt;BR /&gt;
&lt;BR /&gt;
or&lt;BR /&gt;
(where=(schnum='006')) (keep=schnum permnum_s last_s first_s middle_s grade_s efaprim engprof_s advisor_s ela_sort math_sort science_sort social_sort)&lt;BR /&gt;
&lt;BR /&gt;
it is more helpful to see the code when it failed (and preferably in the log) than when things are comented out so it doesn't fail.</description>
      <pubDate>Mon, 22 Feb 2010 20:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61242#M17374</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-02-22T20:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: PROC export  with a KEEP statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61243#M17375</link>
      <description>Here is the failed code:&lt;BR /&gt;
&lt;BR /&gt;
proc export data=astu_efa_sort (where=(schnum='006'))&lt;BR /&gt;
(keep=schnum permnum_s last_s first_s middle_s grade_s efaprim engprof_s advisor_s ela_sort math_sort science_sort social_sort)	&lt;BR /&gt;
outfile='G:\Departments\Research\TESTING\PASS\2010\TestingRosters\prelim_roster.xls'&lt;BR /&gt;
dbms=excel&lt;BR /&gt;
replace;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 22 Feb 2010 20:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61243#M17375</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2010-02-22T20:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC export  with a KEEP statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61244#M17376</link>
      <description>Your KEEP= and WHERE= both must be located inside a set of parentheses for the particular dataset being referenced.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 22 Feb 2010 21:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61244#M17376</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-22T21:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: PROC export  with a KEEP statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61245#M17377</link>
      <description>the where and keep options should be inside one set of parenthesis.  See the following:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a001000998.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a001000998.htm&lt;/A&gt;</description>
      <pubDate>Mon, 22 Feb 2010 21:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-export-with-a-KEEP-statement/m-p/61245#M17377</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-02-22T21:12:10Z</dc:date>
    </item>
  </channel>
</rss>

