Hi,
I need to get UNC path for a mapped drive as different users have their HOME drive on different servers.
I use the getUNC macro from the really good paper “The Path, The Whole Path, And Nothing But the Path, So Help Me Windows” by Arthur L. Carpenter (http://www2.sas.com/proceedings/forum2008/023-2008.pdf).
%MACRO getUNC ;
DATA _NULL_;
length input_dir $200 output_dir $200;
* The input directory can only be a drive letter + colon ONLY e.g. j: ;
input_dir = 'h:';
output_dir = ' ';
output_len = 200;
call module("WNetGetConnectionA", input_dir, output_dir, output_len);
call symputx('dir',input_dir,'l');
call symputx('path',output_dir,'l');
RUN;
%put drive letter is &dir;
%put path is &path;
%MEND getunc;
%getunc;
But get following error:
NOTE: Invalid argument to function MODULE('WNetGetConne'[12 of 18 characters shown],'h:
'[12 of 200 characters shown],' '[12 of 200 characters shown],200) at line
1 column 186.
input_dir=h: output_dir= output_len=200 _ERROR_=1 _N_=1
I am on Window 10 and use SAS 9.4
Can anyone see what is going wrong?
... View more