Date: Fri, 5 Sep 2008 16:38:50 -0400
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: macro problem
In-Reply-To: <48C151B4020000100D76C46E@GWIA1.umsmed.edu>
Content-Type: text/plain; charset=us-ascii
either
> %if %upcase(%substr(&dat,1,2))=HS %then %do;
or, if you insist that your test is quoted:
> %if "%upcase(%substr(&dat,1,2))"="HS" %then %do;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Jamil Ibrahim
> Sent: Friday, September 05, 2008 4:35 PM
> To: sas
> Cc: Jamil Ibrahim
> Subject: macro problem
>
> What is wrong with macro?
>
> %macro dept;
> %if %upcase(%substr("&dat",1,2))="HS" %then %do;
> %let tit=%str(DEPARTMENT OF HEALTH SCIENCES); %end;
> %else %if %upcase(%substr("&dat",1,2))="HI" %then %do;
> %let tit=%str(DEPARTMENT OF HEALTH INFORMATION MANAGEMENT); %end;
> %mend; %dept;
>
> NOTE: One or more missing close parentheses have been
> supplied for the %UPCASE function.
> ERROR: A character operand was found in the %EVAL function or
> %IF condition where a numeric operand is required. The condition was:
> %upcase(%substr("&dat",1,2))="HS"
> ERROR: The macro DEPT will stop executing.
>
>
>
> Dr. Jamil Ibrahim, Ph.D.
> Scientist IV
> Professor , SHRP
> Research Supervisor
> Univ. Of Miss. Med. CTR.
> 2500 N state St
> Jackson, MS 39216
> Tel. 601-984-1197
> Fax 601-984-1205
> Nternet: jibrahim@acadaff.umsmed.edu
> The information contained in the attachment(s) to this email
> is confidential. If you were not expecting a confidential
> email from the Department of Institutional Research at the
> University of Mississippi Medical Center, please do not view,
> open, disclose, reproduce, distibute or otherwise use this
> attachment. If you received this email in error, please
> notify me immediately. Thank you.
>
>
>
> Individuals who have received this information in error or
> are not authorized to receive it must promptly return or
> dispose of the information and notify the sender. Those
> individuals are hereby notified that they are strictly
> prohibited from reviewing, forwarding, printing, copying,
> distributing or using this information in any way.
>
>
|