Date: Wed, 4 Aug 2004 16:43:12 -0400
Reply-To: "Fehd, Ronald J. (PHPPO)" <RJF2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (PHPPO)" <RJF2@CDC.GOV>
Subject: Re: question on %substr(&arg1,&arg2,&arg3)
Content-Type: text/plain; charset="US-ASCII"
> From: Ben
> Hi,How could I check if the last character of a path is '/'
> using Macro facility?
%Let Path = c:\temp\;
%Let slash = %substr(&Path,%length(&Path.),1);
%Put Slash<&Slash.>;
*you need the macro in the archives below;
%Put the last character of Path<&Path.> is
%ifthen(&Slash. eq \
,true =
,false=knot
) a slash;
check our most excellent archives:
http://www.listserv.uga.edu/archives/sas-l.html
search for: ifthen
substring search: [X]
subject contains:
author's address: RJF2
since: Jun 2004
until:
within a macro:
%if %substr(&Path,%length(&Path.),1) eq \ %then ...;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
|