<?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: dCreate returns empty string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643316#M191973</link>
    <description>&lt;P&gt;Thank all for your suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the key information and probably I don't explain it clearly enough is that I am trying to create the folder in &lt;STRONG&gt;my local machine&lt;/STRONG&gt;, not in the server!&lt;/P&gt;&lt;P&gt;I already have the reports generated in the server but I need to download them to my local machine. I am using the "Copy Files" add-in but it needs the folder to exist and I can't figure out how to ensure the folder exist and if not, create it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Apr 2020 15:17:31 GMT</pubDate>
    <dc:creator>Frn747</dc:creator>
    <dc:date>2020-04-27T15:17:31Z</dc:date>
    <item>
      <title>dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643214#M191929</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a folder for my output reports and I have tried all of these options:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put NOTE: creating folder (%sysfunc(dcreate(Reports, ParentDir)));

%put NOTE: creating folder (%sysfunc(dcreate('Reports', 'ParentDir')));

%put NOTE: creating folder (%sysfunc(dcreate("Reports", "ParentDir")));A&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;At least, one of them should be correct but in all of the cases, the output is the same:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: creating folder ()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;No output directory, no errors, no nothing. Just a blank string (and of course, the folder has not been created).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working in a pretty restricted environment (SAS 9.3) and I can't use either shell escape commands (like X or SysExec). Probably my problem is due to some other admin restriction but: no output at all? nothing? not an error or a warning?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any clue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 08:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643214#M191929</guid>
      <dc:creator>Frn747</dc:creator>
      <dc:date>2020-04-27T08:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643216#M191930</link>
      <description>&lt;P&gt;The documentation of dcreate says: "If the directory cannot be created, then DCREATE returns an empty string."&lt;/P&gt;
&lt;P&gt;If you are using dcreate with %sysfunc, you need to use macro-variables, if "ParentDir" is a dataset-variable, don't use %sysfunc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 08:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643216#M191930</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-04-27T08:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643219#M191931</link>
      <description>&lt;P&gt;Thanks Andreas for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried with macro-variables and with a data step with the same result:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let newdir = 'Reports';
%let parentdir = 'C:\Users\Public\Documents\SAS Learning\';
%put NOTE: creating folder (%sysfunc(dcreate(&amp;amp;newdir, &amp;amp;parentdir)));

data _null_;
	new = dcreate('Reports', 'C:\Users\Public\Documents\SAS Learning\');
	put "NOTE: creating folder (" new ")";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have rights in that folder. I have no clues why the directory cannot be created!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 09:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643219#M191931</guid>
      <dc:creator>Frn747</dc:creator>
      <dc:date>2020-04-27T09:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643246#M191945</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/324588"&gt;@Frn747&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have rights in that folder.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did you check that by logging on to the SAS server and testing md from the commandline?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 11:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643246#M191945</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-27T11:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643248#M191947</link>
      <description>No, I didn't.&lt;BR /&gt;I only use Enterprise Guide and I don't think I can log on to the SAS server (or at least, I don't know how to).</description>
      <pubDate>Mon, 27 Apr 2020 11:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643248#M191947</guid>
      <dc:creator>Frn747</dc:creator>
      <dc:date>2020-04-27T11:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643264#M191955</link>
      <description>&lt;P&gt;Then from where do you take it that you have the necessary permissions, or that the path exists at all?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 12:23:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643264#M191955</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-27T12:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643265#M191956</link>
      <description>&lt;P&gt;Don't put quotes into macro variables, unless you need the quotes in the strings you are generating.&lt;/P&gt;
&lt;P&gt;Make sure that the parent directory exists on the machine where SAS is running. Try FILEEXIST(). And is a directory and not a normal file try DOPEN().&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 12:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643265#M191956</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-27T12:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643270#M191958</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/324588"&gt;@Frn747&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks Andreas for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I already tried with macro-variables and with a data step with the same result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let newdir = 'Reports';
%let parentdir = 'C:\Users\Public\Documents\SAS Learning\';
%put NOTE: creating folder (%sysfunc(dcreate(&amp;amp;newdir, &amp;amp;parentdir)));

data _null_;
	new = dcreate('Reports', 'C:\Users\Public\Documents\SAS Learning\');
	put "NOTE: creating folder (" new ")";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have rights in that folder. I have no clues why the directory cannot be created!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The first try won't work due to using quoted strings, as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp; already said. The data-null-step should work, if the path &lt;CODE class=" language-sas"&gt;C:\Users\Public\Documents\SAS Learning\&lt;/CODE&gt; exists &lt;STRONG&gt;on the server&lt;/STRONG&gt;. The blank in "SAS Learning" could cause trouble, that's why i hardly every use blanks in filenames or directory-names.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 12:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643270#M191958</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-04-27T12:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643316#M191973</link>
      <description>&lt;P&gt;Thank all for your suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the key information and probably I don't explain it clearly enough is that I am trying to create the folder in &lt;STRONG&gt;my local machine&lt;/STRONG&gt;, not in the server!&lt;/P&gt;&lt;P&gt;I already have the reports generated in the server but I need to download them to my local machine. I am using the "Copy Files" add-in but it needs the folder to exist and I can't figure out how to ensure the folder exist and if not, create it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 15:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643316#M191973</guid>
      <dc:creator>Frn747</dc:creator>
      <dc:date>2020-04-27T15:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643318#M191974</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/324588"&gt;@Frn747&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank all for your suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that the key information and probably I don't explain it clearly enough is that I am trying to create the folder in &lt;STRONG&gt;my local machine&lt;/STRONG&gt;, not in the server!&lt;/P&gt;
&lt;P&gt;I already have the reports generated in the server but I need to download them to my local machine. I am using the "Copy Files" add-in but it needs the folder to exist and I can't figure out how to ensure the folder exist and if not, create it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you need to edit the code of the Copy Files add-in. Which is NOT SAS code.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 15:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643318#M191974</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-27T15:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: dCreate returns empty string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643323#M191976</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/324588"&gt;@Frn747&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank all for your suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that the key information and probably I don't explain it clearly enough is that I am trying to create the folder in &lt;STRONG&gt;my local machine&lt;/STRONG&gt;, not in the server!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is a fairly key distinction, EG is likely on your server and cannot see or access your local machine. So you cannot pass commands to your local machine in this manner, UNLESS you can select run locally in EG. Even then you cannot have local and server processes in the same process flow.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 15:34:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dCreate-returns-empty-string/m-p/643323#M191976</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-04-27T15:34:38Z</dc:date>
    </item>
  </channel>
</rss>

