Date: Wed, 11 May 2005 01:02:29 -0700
Reply-To: RolandRB <rolandberry@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: RolandRB <rolandberry@HOTMAIL.COM>
Organization: http://groups.google.com
Subject: Re: %fmtpath macro failes.
In-Reply-To: <1115797215.359205.246420@g44g2000cwa.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
Better still is the below which will cope with separating commas with
no spaces.
%macro fmtpath;
%local i cat cats catlist;
%let cats=%sysfunc(compress(%sysfunc(getoption(fmtsearch)),%(%)));
%let cats=%sysfunc(translate(%quote(&cats),%str( ),%str(,)));
%do i=1 %to %words(&cats);
%let cat=%qscan(&cats,&i,%str( ));
%if not %index(&cat,.) %then %let cat=&cat..FORMATS;
%let catlist=&catlist &cat;
%end;
%if not %index(&catlist,LIBRARY.FORMATS) %then %let
catlist=LIBRARY.FORMATS &catlist;
%if not %index(&catlist,WORK.FORMATS) %then %let catlist=WORK.FORMATS
&catlist;
&catlist
%mend;
|