23 /*** sample code to create a directory and move a file to that directory ***;*/
24 %let from_file=%str('z:\Test.txt');
25 %let to_file=%str('z:\test\test.txt');
26 %let new_directory=%str('z:\test\');
27
28 Filename SASCBTBL "V:\CORPDATA72\sas_eor\RENO_HMS\Library\SASCBTBl.TXT";
29
30
31 DATA _NULL_;
32 From_file=&from_file;
33 To_file=&to_file;
34
35 New_directory=&new_directory;
36 Rc1=modulen('*i','CreateDirectoryA',new_directory,0);
37 /* Since the CreateDirectory function returns a Boolean value,;
38 * the MODULEN function is used.;
39 * 0 makes sure the security settings are the default settings in windows,;
40 * change at your own risk;*/
41 Rc2=modulen('*i','MoveFileA',from_file,to_file);
42 /* Since the MoveFile function returns a Boolean value,;
43 * the MODULEN function is used.;*/
44 %Put rc1= rc2=;
rc1= rc2=
45 Run;
WARNING: SASCBTBL file could not be opened.
ERROR: Module CreateDirectoryA could not be loaded. So I have a need to create new directories within the Windows environment using SAS EG. Due to admin rules the various uses of external OS command features are not available. (i.e. x mkdir -p.., rc = system('mkdir...) Something that may be available to me is the use of the module function for which I have found several examples and have tried to convert to use. While using the attached code the statement: Filename SASCBTBL "V:\CORPDATA72\sas_eor\RENO_HMS\Library\SASCBTBl.TXT"; fails with the following error: WARNING: SASCBTBL file could not be opened. I have altered single and double quotes as well as file name length and extension. Any suggestions?
... View more