LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 25 Aug 2010 11:14:45 -0700
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: Rename File with SAS
Content-Type: text/plain; charset=ISO-8859-1

Ash,

In answer to your original question, the following works for me:

%let path=k:\art\; options noxwait;

filename names pipe "dir /b &path.a_*.csv"; data files; infile names lrecl=256 truncover; input oldname $256.; if upcase(scan(oldname,-1,'.'))^='CSV' then delete; oldname=oldname; newname = tranwrd(oldname,'A_','CC_'); oldname=catt("&path.",oldname); call system('rename '||quote(trim(oldname))||' '|| quote(trim(newname))); *call system('rename '||trim(oldname)||' '|| trim(newname)); run;

HTH, Art ----------------- On Aug 25, 11:30 am, ash007 <ramsamyash...@gmail.com> wrote: > thanks for the info. > > how can I build a macro variable equal to 'DIR "C:\USERS\SUADEO > \DESKTOP\NOUVEAU DOSSIER\" /B *.CSV'; > > I don't know how to put the " > > Thanks. ash > > DATA _NULL_; > FICHIERPIPE = CAT( > "'", > "DIR ", > ???, "&__LOCALISATION.", ??? > " /B", > " *.", > "&__TYPE", > "'" > ); > > CALL SYMPUT('__FICHIERPIPE',TRIM(FICHIERPIPE)); > RUN; %PUT &__FICHIERPIPE.; > > FILENAME NAMES PIPE "&__FICHIERPIPE.";


Back to: Top of message | Previous page | Main SAS-L page