<?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: Close all VIEWTABLES in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/503329#M809</link>
    <description>&lt;P&gt;In&amp;nbsp;Windows 7: Click Start button, then "Standard Programs" (this can also be accessed via &lt;EM&gt;Control Panel&lt;/EM&gt;), then "Associate a file type or protocol with a program". In the long list of&amp;nbsp;filename extensions scroll down and select&amp;nbsp;.sas7bdat, click "Change program" button and select SAS.UniViewer (if this is not listed, click Browse and navigate to the SAS.UniViewer.exe, which may reside in&amp;nbsp;C:\Program Files\SASHome\SASUniversalViewer\1.4 [or higher version number] or wherever you installed it). Confirm with OK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="univiewer.png" style="width: 418px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23946i1DB74BB539530E14/image-size/large?v=v2&amp;amp;px=999" role="button" title="univiewer.png" alt="univiewer.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While you're at it, you may want to associate file type .sas with SAS.UniViewer as well. I find this quite convenient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2018 08:18:46 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-10-11T08:18:46Z</dc:date>
    <item>
      <title>Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502637#M697</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I want to develop a simple code to close all viewtables before running the rest of the program.&lt;BR /&gt;&lt;BR /&gt;Here is what I managed to find so far:&lt;/P&gt;&lt;PRE&gt;dm 'next VIEWTABLE:; end;'; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;which only closes one table.&lt;BR /&gt;&lt;BR /&gt;Therefore I am looking for a way to run this code many times to close all viewtables.&lt;BR /&gt;&lt;BR /&gt;Here is what I have attempted so far:&lt;BR /&gt;1:Using a do loop in a data step (works only once then returns an error because the "end"s disturb the do block:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT size="2"&gt;data _null_;
	do i=1 to 20;
		dm 'next VIEWTABLE:; end;'; 
	end; 
run;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;BR /&gt;2:Using a macro statement (doesn't work) in order to have one "end" and another "%end" without confusion for the do block:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face="Courier New"&gt;%macro closevts;
	 
	%do i=1 %to 20; 
		dm 'next VIEWTABLE:; end;'; 
	%end; 
%mend;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;3: putting a do&amp;nbsp;loop in a datastep inside the macro statement (doesn't do anything):&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT size="2"&gt;%macro closevts;
	 
	%do i=1 %to 20; 
		data _null_;
			dm 'next VIEWTABLE:; end;'; 
		run;
	%end; 
%mend;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Anyone can help me with this please?&lt;BR /&gt;&lt;BR /&gt;Best,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 10:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502637#M697</guid>
      <dc:creator>pkopersk</dc:creator>
      <dc:date>2018-10-09T10:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502654#M698</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which SAS product are you using, SAS Base?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a tick box in the options window that does this for you automatically before a program runs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a tick box option in SAS EG to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 11:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502654#M698</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2018-10-09T11:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502662#M699</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am using SAS BASE and don't have access to SAS EG so I guess&amp;nbsp;it has to be done with a script. I checked everywhere and there is no checkbox option to do that.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 11:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502662#M699</guid>
      <dc:creator>pkopersk</dc:creator>
      <dc:date>2018-10-09T11:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502685#M701</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the data step you loop 20 times. Are there at least 20 data sets open? If not, reduce the loop to the number of viewtable windows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the error message you see with the data step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 13:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502685#M701</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2018-10-09T13:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502686#M702</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207645"&gt;@pkopersk&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your approach no. 2 works for me. You &lt;EM&gt;called&lt;/EM&gt; the macro, didn't you?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%closevts&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Oct 2018 13:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502686#M702</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-09T13:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502690#M703</link>
      <description>Nope I did not!&lt;BR /&gt;&lt;BR /&gt;Thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 09 Oct 2018 13:52:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502690#M703</guid>
      <dc:creator>pkopersk</dc:creator>
      <dc:date>2018-10-09T13:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502697#M704</link>
      <description>&lt;P&gt;You're welcome. Don't worry, you're not the first programmer who forgot this. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess&amp;nbsp;you want to close the Viewtables because you dislike this error message:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;ERROR: You cannot open WORK.YOUR.DATA for output access with member-level control because
       WORK.YOUR.DATA is in use by you in resource environment ViewTable Window.&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;So do I and this is one reason why I prefer the&amp;nbsp;&lt;A href="https://support.sas.com/downloads/package.htm?pid=2173" target="_blank"&gt;SAS Universal Viewer&lt;/A&gt;&amp;nbsp;to Viewtables. I've adjusted the settings in my Windows Explorer so that a double-click on a .sas7bdat file opens the SAS Universal Viewer with that dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 14:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/502697#M704</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-09T14:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/503320#M808</link>
      <description>&lt;P&gt;Hey I downloaded SAS viewer but I don't see where I can edit the setting to reproduce what you did. Can you be so kind and describe where I can do this please?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 07:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/503320#M808</guid>
      <dc:creator>pkopersk</dc:creator>
      <dc:date>2018-10-11T07:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Close all VIEWTABLES</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/503329#M809</link>
      <description>&lt;P&gt;In&amp;nbsp;Windows 7: Click Start button, then "Standard Programs" (this can also be accessed via &lt;EM&gt;Control Panel&lt;/EM&gt;), then "Associate a file type or protocol with a program". In the long list of&amp;nbsp;filename extensions scroll down and select&amp;nbsp;.sas7bdat, click "Change program" button and select SAS.UniViewer (if this is not listed, click Browse and navigate to the SAS.UniViewer.exe, which may reside in&amp;nbsp;C:\Program Files\SASHome\SASUniversalViewer\1.4 [or higher version number] or wherever you installed it). Confirm with OK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="univiewer.png" style="width: 418px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23946i1DB74BB539530E14/image-size/large?v=v2&amp;amp;px=999" role="button" title="univiewer.png" alt="univiewer.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While you're at it, you may want to associate file type .sas with SAS.UniViewer as well. I find this quite convenient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 08:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Close-all-VIEWTABLES/m-p/503329#M809</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-11T08:18:46Z</dc:date>
    </item>
  </channel>
</rss>

