options noxwait;
/* create a directory with the system function and mkdir command*/
data _null_;
rc = system('mkdir D:\Docs\z');
put rc=;
run;
/*change default directory*/
x 'cd D:\Docs\z';
/*export a data file to the default directory*/
proc export data=outfile="test.csv" dbms=csv replace;
run;
/* display the directory with the pipe option and dir command*/
filename fileref PIPE 'dir /q D:\Docs\z';
data _null_;
infile fileref;
input ;
put _infile_;
run;
/* delete files and subdir in a directory with rd command*/
data _null_;
rc = system('rd/s/q D:\Docs\z');
put rc=;
run;
/*--- /s Removes all directories and files in the specified directory in ---*/
/*--- addition to the directory itself. Used to remove a directory tree. ---*/
/*--- /q Quiet mode, do not ask if ok to remove a directory tree with /s. ---*/
other commands for managing directory and the contents
del /q "filename"
for deleting file(s) in a directory without prompting
ren *.csv *.txt
for changing the extensions of all the file names in the current directory
/* create a directory with the system function and mkdir command*/
data _null_;
rc = system('mkdir D:\Docs\z');
put rc=;
run;
/*change default directory*/
x 'cd D:\Docs\z';
/*export a data file to the default directory*/
proc export data=outfile="test.csv" dbms=csv replace;
run;
/* display the directory with the pipe option and dir command*/
filename fileref PIPE 'dir /q D:\Docs\z';
data _null_;
infile fileref;
input ;
put _infile_;
run;
/* delete files and subdir in a directory with rd command*/
data _null_;
rc = system('rd/s/q D:\Docs\z');
put rc=;
run;
/*--- /s Removes all directories and files in the specified directory in ---*/
/*--- addition to the directory itself. Used to remove a directory tree. ---*/
/*--- /q Quiet mode, do not ask if ok to remove a directory tree with /s. ---*/
other commands for managing directory and the contents
del /q "filename"
for deleting file(s) in a directory without prompting
ren *.csv *.txt
for changing the extensions of all the file names in the current directory