Hi ,SASPhile, Fixed code:
options noxwait;
%let my_dir=C:\Documents and Settings\skap\Desktop\inpt;
data _null_;
dir_cmd='dir "'||"&my_dir"||'"';
rc=filename('dir',dir_cmd,'pipe');
run;
data d;
infile dir pad truncover;
input date $10.@;
if date ='' or date='Volume' or length(date) <10 then delete;
else input time $ ampm $ dir $ name $200.;
if trim(dir)=' ' then delete;
if index(name,'GH Utilization') then
do;
nm='caremark';
cmd='ren "'||"&my_dir\"||trim(left(name)) ||'" "'||compress(left(nm)||'_'||year(today())||'_'||put(month(today()),z2.)||'.xls"') ;
put cmd=;
rc=system(cmd);
end;
run;
lu.
Message was edited by: lu
... View more