<?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: %SYSFUNC open in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468850#M119806</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It tried the code you gave me, but below was the message I got. RC4 is my dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: You cannot open WORK.RC4.DATA for output access with member-level control because&lt;BR /&gt;WORK.RC4.DATA is in use by you in resource environment DMS Process.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 20:08:52 GMT</pubDate>
    <dc:creator>Klauth</dc:creator>
    <dc:date>2018-06-08T20:08:52Z</dc:date>
    <item>
      <title>%SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463144#M117942</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used two lines to open a dataset in my macro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let dataset=temp;&lt;/P&gt;&lt;P&gt;%let nobs=%sysfunc(attrn(%sysfunc(open(&amp;amp;ds)),NOBS));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the sysfunc&amp;nbsp;close in order to close, but I learned that my dataset was not closed because I couldn't make changes to the dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone tell me what I can do to close the dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bo klauth&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 20:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463144#M117942</guid>
      <dc:creator>Klauth</dc:creator>
      <dc:date>2018-05-17T20:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463150#M117945</link>
      <description>&lt;P&gt;If your trying to get the number of observation in a SAS Dataset then why not query the VTABLE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
PROC SQL; 
select nobs INTO: nobs 
from sashelp.vtable
where libname="SASHELP" and memname="CLASS"
;
quit;

%PUT "Number of Observetions:&amp;amp;nobs";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 May 2018 20:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463150#M117945</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-05-17T20:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463152#M117946</link>
      <description>&lt;P&gt;have you tried to close with proc iml close statement? just a random crazy thought of mine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="text"&gt;proc iml;

close yourdataset;  &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;hmm , by any chance an admin related issue after all?&amp;nbsp;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 20:36:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463152#M117946</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-17T20:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463153#M117947</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Suryakiran,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your response. I used the whole thing you wrote. The result was 19. Would I need to chang anything? I have 45 observations in my dataset.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bo Klauth&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 20:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463153#M117947</guid>
      <dc:creator>Klauth</dc:creator>
      <dc:date>2018-05-17T20:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463158#M117949</link>
      <description>&lt;P&gt;SASHELP.VTABLE or DICTIONARY.TABLES are read only tables that contains SAS session information. It contains lot of useful information about tables like column names, format, number of recods...etc. 'nobs' is one peice in it that gives the count on a dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL; 
create table test as
select * 
from sashelp.vtable
where libname="SASHELP" and memname="CLASS"
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run this and see what all information it can give. LIBNAME=the library where your table is, memname= you dataset name&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 20:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463158#M117949</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-05-17T20:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463163#M117952</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209439"&gt;@Klauth&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used two lines to open a dataset in my macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let dataset=temp;&lt;/P&gt;
&lt;P&gt;%let nobs=%sysfunc(attrn(%sysfunc(open(&amp;amp;ds)),NOBS));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the sysfunc&amp;nbsp;close in order to close, but I learned that my dataset was not closed because I couldn't make changes to the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone tell me what I can do to close the dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bo klauth&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why do you need to know the number of observations?&amp;nbsp; What do you do with the number?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 21:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463163#M117952</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-05-17T21:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463164#M117953</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209439"&gt;@Klauth&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used two lines to open a dataset in my macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let dataset=temp;&lt;/P&gt;
&lt;P&gt;%let nobs=%sysfunc(attrn(%sysfunc(open(&amp;amp;ds)),NOBS));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the sysfunc&amp;nbsp;close in order to close, but I learned that my dataset was not closed because I couldn't make changes to the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone tell me what I can do to close the dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bo klauth&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have to have the identifier of which file that has been opened you want to close. You do not show how you attempted to close it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of nesting function calls opening the dataset&amp;nbsp;you are likely better off to use something like:&lt;/P&gt;
&lt;P&gt;%let dsid&amp;nbsp; = %sysfunc(&lt;FONT style="background-color: rgb(252, 222, 192);"&gt;open&lt;/FONT&gt;(&amp;amp;ds, i));&lt;/P&gt;
&lt;P&gt;%let nobs = %sysfunc(attrn(&amp;amp;dsid));&lt;/P&gt;
&lt;P&gt;%let rc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %sysfunc(close(&amp;amp;dsid));&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 21:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463164#M117953</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-17T21:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463245#M117995</link>
      <description>&lt;P&gt;Insert your library and dataset name in place of SASHELP and CLASS, respectively (use capitals only).&lt;/P&gt;
&lt;P&gt;19 is the number of observations in SASHELP.CLASS.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209439"&gt;@Klauth&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Suryakiran,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for your response. I used the whole thing you wrote. The result was 19. Would I need to chang anything? I have 45 observations in my dataset.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Bo Klauth&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 08:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/463245#M117995</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-18T08:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468850#M119806</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It tried the code you gave me, but below was the message I got. RC4 is my dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: You cannot open WORK.RC4.DATA for output access with member-level control because&lt;BR /&gt;WORK.RC4.DATA is in use by you in resource environment DMS Process.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 20:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468850#M119806</guid>
      <dc:creator>Klauth</dc:creator>
      <dc:date>2018-06-08T20:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468852#M119807</link>
      <description>&lt;P&gt;Hi Klauth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You are getting this error most likely because you have the dataset open. Close and dataset you have open and rerun the code, you should no longer have this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 20:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468852#M119807</guid>
      <dc:creator>ybolduc</dc:creator>
      <dc:date>2018-06-08T20:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468854#M119808</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please tell me more how I can get the number of observations to use? I ran your code, it appeared to be working, but I didn't see the number of observations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 20:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468854#M119808</guid>
      <dc:creator>Klauth</dc:creator>
      <dc:date>2018-06-08T20:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468855#M119809</link>
      <description>&lt;P&gt;The nobs column contains the number of observations, its label is "Number of Physical Observations".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a document with some information about the SASHELP Views: &lt;A href="http://www2.sas.com/proceedings/sugi26/p017-26.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi26/p017-26.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 20:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468855#M119809</guid>
      <dc:creator>ybolduc</dc:creator>
      <dc:date>2018-06-08T20:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468860#M119810</link>
      <description>&lt;P&gt;Never mind. I got it to work. Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 20:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468860#M119810</guid>
      <dc:creator>Klauth</dc:creator>
      <dc:date>2018-06-08T20:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSFUNC open</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468862#M119811</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 20:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSFUNC-open/m-p/468862#M119811</guid>
      <dc:creator>Klauth</dc:creator>
      <dc:date>2018-06-08T20:45:54Z</dc:date>
    </item>
  </channel>
</rss>

