<?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: about OPEN function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145277#M28985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try FETCH() &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Mar 2014 14:53:42 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-03-16T14:53:42Z</dc:date>
    <item>
      <title>about OPEN function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145274#M28982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Hi SAS team!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;My code was like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;%macro a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;data sample1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;a=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;data lack;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;%let s1=%sysfunc(open(sample1));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;%let lk=%sysfunc(open(lack));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;%if &amp;amp;s1&amp;gt;0 and &amp;amp;lk&amp;gt;0 %then %do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;s1 &amp;amp;lk;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;&amp;nbsp; %end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp; %else %do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put "one of the dataset can not be opened";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp; %end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;%let rc=%sysfunc(close(&amp;amp;s1));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;%let rc=%sysfunc(close(&amp;amp;lk));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;%mend a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;%a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;i expected that the note of "&lt;SPAN style="font-size: 12pt;"&gt;one of the dataset can not be opened&lt;/SPAN&gt;" were written to the LOG, but the result was "&lt;SPAN style="font-size: 12pt;"&gt;1 2&lt;/SPAN&gt;". Would anyone could explain how it happened and &lt;/SPAN&gt;&lt;SPAN style="font-size: 19px;"&gt;demonstrate&lt;/SPAN&gt;&lt;SPAN style="font-size: 14pt;"&gt; the usage of OPEN function or other functions if the former note would be &lt;SPAN style="font-size: large;"&gt;written&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Appreciate any help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Qinly&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 14:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145274#M28982</guid>
      <dc:creator>LinyuanQin</dc:creator>
      <dc:date>2014-03-16T14:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: about OPEN function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145275#M28983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OPEN will return a file handle number. Hence the 1 and 2 that you see in the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They should both successfully open the datasets you just created .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 14:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145275#M28983</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-03-16T14:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: about OPEN function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145276#M28984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thank you, Tom. And if both data sets do exist, but one of them has no obs, just like data set lack, which function could achieve my purpose?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 14:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145276#M28984</guid>
      <dc:creator>LinyuanQin</dc:creator>
      <dc:date>2014-03-16T14:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: about OPEN function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145277#M28985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try FETCH() &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 14:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145277#M28985</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-03-16T14:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: about OPEN function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145278#M28986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Tom! I've solved it by your suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 01:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-OPEN-function/m-p/145278#M28986</guid>
      <dc:creator>LinyuanQin</dc:creator>
      <dc:date>2014-03-17T01:03:16Z</dc:date>
    </item>
  </channel>
</rss>

