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 (May 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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.
Comments: To: sas-l@uga.edu
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;


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