Hello friends - please help i am using below code to transfer some previous day text files to different folder - but x command is not working - i am running this code in base sas since x command is valid. filename all_txt pipe 'dir "d:\woo\test\*.txt" /tw'; data transfer_yesterday_files; attrib buffer format=$2000. file_last_written_date format=yymmdd10. file_last_written_time format=time5. file_name format=$100.; infile all_txt truncover ; input buffer $2000.; /* Remove some extra info */ if substr(buffer,1,5) in ("Volum","Direc") or index(buffer,"<DIR>")>0 or index(buffer,"Dir(s)")>0 or index(buffer,"File(s)")>0 then delete; file_last_written_date=input(put(scan(compbl(buffer),1,' '),$10.),mmddyy10.); /* note dependant on system settings */ file_last_written_time=input(put(scan(compbl(buffer),2,' '),$5.),time5.); file_name=trim(scan(compbl(buffer),5,' ')) ; if file_name = ' ' then delete ; run; data _null_; tempdate1=intnx('day',today(),0); tempdate2=intnx('day',today(),-1); tempdate3=intnx('day',today(),-2); tempdate4=intnx('day',today(),-3); tempdate5=intnx('day',today(),-4); tempdate6=intnx('day',today(),-5); tempdate7=intnx('day',today(),-6); call symput('date1',put(tempdate1,yymmdd10.)); call symput('date2',put(tempdate2,yymmdd10.)); call symput('date3',put(tempdate3,yymmdd10.)); call symput('date4',put(tempdate4,yymmdd10.)); call symput('date5',put(tempdate5,yymmdd10.)); call symput('date6',put(tempdate6,yymmdd10.)); call symput('date7',put(tempdate7,yymmdd10.)); run; %put _user_; data _null_; set transfer_yesterday_files; if file_last_written_date=&date6 then do; x copy "d:\woo\test\*.txt d:\woo\test\transfer\&date6"; /*here &date6=2014-07-18 (if we run code today, 2014-07-23) and i have daily batch process which creates previous day folder in same format, 2014-07-18*/ end; run;
... View more