Hi Filipvdr,
In addition to Cynthia's points, if you are running your stored process code in a SAS Stored Process Server or SAS Workspace Server then it is likely that pipes and executing operating system commands have been disabled via the NOXCMD option (it is the default for the SASApp application server). If that is the case then the SAS platform administrator could possibly enable the XCMD option but it has security implications and may not be appropriate.
Another way of creating directories without using pipes or operating system commands is to use the DCREATE function. This is an SCL function but is also available in the data step. Here is an example of creating the
newfolder folder in the
d:\ parent directory (i.e.
d:\newfolder😞
data _null_;
newdirname=dcreate('newfolder', 'd:\');
put newdirname=;
run;
You can use it in the %sysfunc macro function too:
%let newdir=%sysfunc(dcreate(newfolder,/tmp));
%put &newdir;
You should find that dcreate works even when NOXCMD is in effect. The documentation for the dcreate function at
http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/viewer.htm#a000308115.htm
Cheers
Paul