<?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 Proc exprt (condition) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47632#M9858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I did. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's a lot &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://communities.sas.com/people/Hai.kuo" id="jive-506829113526387595803" style="background-color: #f9f9f9; color: #0e66ba; font-weight: bold; text-align: center;"&gt;Hai.kuo&lt;/A&gt; and &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://communities.sas.com/people/art297" id="jive-14959429113526384319803" style="background-color: #f9f9f9; color: #0e66ba; font-weight: bold; text-align: center;"&gt;art297&lt;/A&gt;&amp;nbsp; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Bye.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Feb 2012 14:52:18 GMT</pubDate>
    <dc:creator>Cello23</dc:creator>
    <dc:date>2012-02-07T14:52:18Z</dc:date>
    <item>
      <title>Proc exprt (condition)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47629#M9855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;Help&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;please&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;It 's possibile insert&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;a condition in&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;export&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;that in&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;case the table&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;to be exported&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;has not&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;a row:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;﻿&lt;IMG alt="no row.jpg" class="jive-image" src="https://communities.sas.com/legacyfs/online/1454_no row.jpg" /&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;the export&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;must not&lt;/SPAN&gt; &lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;be.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps" style="font-family: arial, sans-serif; font-size: 16px; text-align: -webkit-auto; background-color: #f5f5f5;"&gt;Thank's&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 09:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47629#M9855</guid>
      <dc:creator>Cello23</dc:creator>
      <dc:date>2012-02-07T09:35:56Z</dc:date>
    </item>
    <item>
      <title>Proc exprt (condition)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47630#M9856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest way I've seen is to insert a macro variable in your code.&amp;nbsp; Take a look at: &lt;A href="http://support.sas.com/resources/papers/proceedings11/097-2011.pdf"&gt;http://support.sas.com/resources/papers/proceedings11/097-2011.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 13:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47630#M9856</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-07T13:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc exprt (condition)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47631#M9857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Art. Here is an example that you may find useful to your scenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;set sashelp.class (obs=0);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test;&lt;/P&gt;&lt;P&gt;%let imp_data=have;&lt;/P&gt;&lt;P&gt;/*%let exp_data=;*/&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;if nobs&amp;gt;0 then call symput("exp_data","&amp;amp;imp_data");&lt;/P&gt;&lt;P&gt;else&amp;nbsp; call symput ("exp_data","");&lt;/P&gt;&lt;P&gt;set &amp;amp;imp_data nobs=nobs;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%if &amp;amp;exp_data ne %then %do;&lt;/P&gt;&lt;P&gt;proc export data=&amp;amp;exp_data&lt;/P&gt;&lt;P&gt;outfile="h:\test.xls"&lt;/P&gt;&lt;P&gt;dbms=excel replace;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; you can toggle from obs=0 to obs=10 to test it out. Make sure the outfile destination is valid for your system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After browsing the paper that Art referred, here comes another version utilizing 'run cancel' method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;if nobs&amp;gt;0 then call symput("rc","");&lt;/P&gt;&lt;P&gt;else&amp;nbsp; call symput ("rc","cancel");&lt;/P&gt;&lt;P&gt;set have nobs=nobs;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc export data=have&lt;/P&gt;&lt;P&gt;outfile="h:\test.xls"&lt;/P&gt;&lt;P&gt;dbms=excel replace;&lt;/P&gt;&lt;P&gt;run &amp;amp;rc;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 13:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47631#M9857</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-02-07T13:44:37Z</dc:date>
    </item>
    <item>
      <title>Proc exprt (condition)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47632#M9858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I did. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's a lot &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://communities.sas.com/people/Hai.kuo" id="jive-506829113526387595803" style="background-color: #f9f9f9; color: #0e66ba; font-weight: bold; text-align: center;"&gt;Hai.kuo&lt;/A&gt; and &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://communities.sas.com/people/art297" id="jive-14959429113526384319803" style="background-color: #f9f9f9; color: #0e66ba; font-weight: bold; text-align: center;"&gt;art297&lt;/A&gt;&amp;nbsp; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Bye.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 14:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-exprt-condition/m-p/47632#M9858</guid>
      <dc:creator>Cello23</dc:creator>
      <dc:date>2012-02-07T14:52:18Z</dc:date>
    </item>
  </channel>
</rss>

