<?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: Opening and closing terminals with an &amp;quot;X statement&amp;quot;? (Or not opening them at all?) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/436919#M282208</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have at least three options that I see:&lt;/P&gt;
&lt;P&gt;Use the NoXSYNC/noxwait option.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0xwt90ik8vxdrn13708w6n3nm4o.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0xwt90ik8vxdrn13708w6n3nm4o.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option noxwait;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use SAS base&amp;nbsp;libname trick to create folders&lt;/P&gt;
&lt;P&gt;You can use the LIBNAME and DLCREATEDIR option.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note that there's a LIBNAME function so that you don't need a macro here either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the DCREATE() function to create a directory&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1aj29pf4cxnirn15q5hmf0tv438.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1aj29pf4cxnirn15q5hmf0tv438.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm more in favour of one of the latter options because they will work on most systems without being changed and because they don't need macro code. X commands are commonly locked down on many installations.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2018 23:13:30 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-13T23:13:30Z</dc:date>
    <item>
      <title>Opening and closing terminals with an "X statement"? (Or not opening them at all?)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/436897#M282206</link>
      <description>&lt;P&gt;Hello, new-ish SAS user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The trouble I'm having is this: whenever I need to use a lot of "X statements" (I don't know the proper terminology for this), for instance I need to create a bunch of folders in some directory, SAS opens a terminal for each and I have to shut it down manually, and I'd of course like to avoid this. There's obviously something I'm missing here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I want to make a bunch of folders folder1, folder2... folder100 within path C:\PATH. Here's the code I would use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x "dir c:\PATH";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro makedirs;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %do i=1 %to 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;x "md folder&amp;amp;i";&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend makedirs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%makedirs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is, I'm going to have to&amp;nbsp;manually shut down 100 windows, when this should actually take no time at all. I've tried adding lines like:&lt;/P&gt;&lt;P&gt;x "exit";&lt;/P&gt;&lt;P&gt;but to no avail. How do I avoid this?&amp;nbsp;Really, how do I tell SAS not to open a terminal window at all?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 22:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/436897#M282206</guid>
      <dc:creator>Schwa</dc:creator>
      <dc:date>2018-02-13T22:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Opening and closing terminals with an "X statement"? (Or not opening them at all?)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/436917#M282207</link>
      <description>I'm using Windows 10, by the way.</description>
      <pubDate>Tue, 13 Feb 2018 23:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/436917#M282207</guid>
      <dc:creator>Schwa</dc:creator>
      <dc:date>2018-02-13T23:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Opening and closing terminals with an "X statement"? (Or not opening them at all?)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/436919#M282208</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have at least three options that I see:&lt;/P&gt;
&lt;P&gt;Use the NoXSYNC/noxwait option.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0xwt90ik8vxdrn13708w6n3nm4o.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0xwt90ik8vxdrn13708w6n3nm4o.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option noxwait;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use SAS base&amp;nbsp;libname trick to create folders&lt;/P&gt;
&lt;P&gt;You can use the LIBNAME and DLCREATEDIR option.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note that there's a LIBNAME function so that you don't need a macro here either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the DCREATE() function to create a directory&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1aj29pf4cxnirn15q5hmf0tv438.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1aj29pf4cxnirn15q5hmf0tv438.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm more in favour of one of the latter options because they will work on most systems without being changed and because they don't need macro code. X commands are commonly locked down on many installations.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 23:13:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/436919#M282208</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-13T23:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Opening and closing terminals with an "X statement"? (Or not opening them at all?)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/437251#M282209</link>
      <description>&lt;P&gt;Thanks! I ended up using the&amp;nbsp;&lt;SPAN&gt;DLCREATEDIR option, works like a charm!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Opening-and-closing-terminals-with-an-quot-X-statement-quot-Or/m-p/437251#M282209</guid>
      <dc:creator>Schwa</dc:creator>
      <dc:date>2018-02-14T18:04:14Z</dc:date>
    </item>
  </channel>
</rss>

