Date: Wed, 27 Nov 2002 15:41:59 -0000
Reply-To: "roland.rashleigh-berry" <roland.rashleigh-berry@NTLWORLD.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "roland.rashleigh-berry" <roland.rashleigh-berry@NTLWORLD.COM>
Organization: ntlworld News Service
Subject: Q: Open MS-DOS windows
I have a small macro that renames a flat file, replaces a special character
with spaces and writes it out to the originally named file. It works just
fine except that it leaves the MS-DOS windows open and I have to close them
by issuing an "exit" command. Can can I do this without leaving those
windows open?
%macro subspace(filename,subspace='FE'x);
%local tempname;
%let filename=%sysfunc(compress(&filename,%str(%'%")));
%let tempname=%scan(&filename,1,.).tmp;
x "rename &filename &tempname";
run;
data _null_;
length str $ 200;
infile "&tempname" pad;
file "&filename";
input @1 str $char200.;
str=translate(str,' ',&subspace);
put @(length(str)-length(left(str))+1) str;
run;
x "erase &tempname";
run;
%mend;
|