全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
14767 35
2012-12-01
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=sashelp.prdsale
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




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-12-1 20:47:43
膜拜大神,每一次都是提高啊!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-12-1 22:35:32
very useful, thanks a lot
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-12-9 13:14:46
膜拜下
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-12-16 15:43:26
弱弱地问下
/* 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;
这部分有啥特别用处吗?主要还是显示文件夹的信息吧
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-12-16 16:04:39
Eternal0601 发表于 2012-12-16 15:43
弱弱地问下
/* display the directory with the pipe option and dir command*/
filename fileref PIPE ' ...
yeah! u r right.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群