<?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 Save output of %sysexec to a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583374#M166065</link>
    <description>&lt;P&gt;Hi, I'm fairly new to SAS, and I'm trying to get a list of folders in a specific directory saved as a dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get the folders using %sysexec like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%sysexec(dir -l "&amp;lt;folder location&amp;gt;" );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This opens the command prompt, which is not desirable. My question is, is there a way to save the command line output generated by this command? Maybe in a new dataset call folder_list or something?&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2019 01:02:14 GMT</pubDate>
    <dc:creator>ABurn</dc:creator>
    <dc:date>2019-08-23T01:02:14Z</dc:date>
    <item>
      <title>Save output of %sysexec to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583374#M166065</link>
      <description>&lt;P&gt;Hi, I'm fairly new to SAS, and I'm trying to get a list of folders in a specific directory saved as a dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get the folders using %sysexec like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%sysexec(dir -l "&amp;lt;folder location&amp;gt;" );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This opens the command prompt, which is not desirable. My question is, is there a way to save the command line output generated by this command? Maybe in a new dataset call folder_list or something?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 01:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583374#M166065</guid>
      <dc:creator>ABurn</dc:creator>
      <dc:date>2019-08-23T01:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Save output of %sysexec to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583378#M166067</link>
      <description>&lt;P&gt;Try running the DIR command inside a piped SAS FILENAME. This post explains how:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/529993#M5628" target="_blank"&gt;https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/529993#M5628&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 01:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583378#M166067</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-08-23T01:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Save output of %sysexec to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583379#M166068</link>
      <description>&lt;P&gt;unfortunately it keeps returning 0 observations. I am using macro variables inside the pipe:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename tmp pipe 'dir "F:\PROJECTS\Active\&amp;amp;FULL_TRIAL.\Data Management\4. Data Validation and Checking\Data Cleaning Procedures\" /b /s';&lt;BR /&gt;&lt;BR /&gt;but I know sometimes macro variables don't work with single quotes. Is there a way around that?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 01:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583379#M166068</guid>
      <dc:creator>ABurn</dc:creator>
      <dc:date>2019-08-23T01:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Save output of %sysexec to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583382#M166070</link>
      <description>&lt;P&gt;Try this instead of a single quote:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%str(%')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also test without the macro variable to ensure it is working correctly in the first instance.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 02:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Save-output-of-sysexec-to-a-dataset/m-p/583382#M166070</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-08-23T02:06:11Z</dc:date>
    </item>
  </channel>
</rss>

