<?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: exporting in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185663#M47147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or the exist function to check the the existence.&lt;/P&gt;&lt;P&gt;%sysfunc(exist(&amp;lt;data_set&amp;gt;));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the open(), as suggested by LinusH, it's better to use the close after the check, otherwise the DataSet could be locked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2014 12:17:35 GMT</pubDate>
    <dc:creator>Barnipaz</dc:creator>
    <dc:date>2014-02-25T12:17:35Z</dc:date>
    <item>
      <title>exporting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185661#M47145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have a set of datasets which I would like to output in an Excel File. Is there a way to do this quickly rather than calling proc export each time for each dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let MyDS = ('out.Ids', 'out.Vars', 'out.Places')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let MyDSname = (Ids, Vars, Places)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a macro that check if each dataset exists and then output to an Excel spreadsheet with the Tab name as specified in the corresponding MyDSname ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like... %macro Out(MySpreadsheetName, MyDS, MyDSname);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 10:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185661#M47145</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2014-02-25T10:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: exporting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185662#M47146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shouldn't be a problem.&lt;/P&gt;&lt;P&gt;Use open() function to check the existence of a data set, then conditionally execute a Proc Export.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 12:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185662#M47146</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-02-25T12:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: exporting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185663#M47147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or the exist function to check the the existence.&lt;/P&gt;&lt;P&gt;%sysfunc(exist(&amp;lt;data_set&amp;gt;));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the open(), as suggested by LinusH, it's better to use the close after the check, otherwise the DataSet could be locked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 12:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185663#M47147</guid>
      <dc:creator>Barnipaz</dc:creator>
      <dc:date>2014-02-25T12:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: exporting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185664#M47148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both. but I am also looking how to Parse my macro variables so as to use the proc Export command I'm not sure how to use the loop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 14:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185664#M47148</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2014-02-25T14:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: exporting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185665#M47149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You just use the macro variables in the code. Perhaps you need to learn a little about macro programming before getting started with this task.&lt;/P&gt;&lt;P&gt;Loop, what loop?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 14:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185665#M47149</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-02-25T14:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: exporting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185666#M47150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Linus, but the macro variable MyDS refers to the list of datasets 3 in this case. The macro variable MyDSname corresponds to the name I want to call the tab in the spreadsheet which they are store.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont think I can just use a proc export directly passing MyDS and MyDSname&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would have to parse MyDS to extract the first value same way MyDSname and then use proc export.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;. I wanst sure how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let MyDS = ('out.Ids', 'out.Vars', 'out.Places') %let MyDSname = (Ids, Vars, Places)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 17:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185666#M47150</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2014-02-25T17:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: exporting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185667#M47151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Effective macro coding always starts with the same place: A base SAS section of code that works.&lt;/P&gt;&lt;P&gt;Provide an example of ONE of the proc exports you are attempting that works and then indicate which pieces change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you almost never need to include quotes in the parameters as they will be treated by the macro processor as text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 18:57:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exporting-in-SAS/m-p/185667#M47151</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-02-25T18:57:58Z</dc:date>
    </item>
  </channel>
</rss>

