Date: Tue, 19 Dec 2006 05:52:30 -0500
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: Setting a macro variable inside a macro.
Content-Type: text/plain; charset=ISO-8859-1
I assume that &subj is macro - local. You can define it outside the macro
and change its value inside, or you GLOBAL it.
The following might show the different ranges of variables:
%let outside=outside;
%macro test;
%let inside=inside;
%let globals=in and outside;
%global globals;
%put inside: &outside;
%put inside: &inside;
%put inside: &globals;
%let outside=changed!;
%mend;
%test;
%put outside: &outside;
%put outside: &inside;
%put outside: &globals;
&INSIDE is a local varible and unknown outside.
On Tue, 19 Dec 2006 16:03:01 +0530, Mohit Bhatia <mohit.b.bhatia@AEXP.COM>
wrote:
>Hi,
>
>I want to set a macro variable subj inside a macro based on a condition.
But this is not working. Kindly
>suggest why. Is the statement inside IF ok?
>
>
>
>%macro checkerrors;
>%if (&prod_class_invalid='Y' or &prod_type_invalid='Y'or
>&source_invalid='Y' or &contact_invalid='Y' or &presac_invalid='N' or
>&acct12_missing ='Y' or &sac_date_missing='Y') %then %do;
>
>%let subj=NOK;
>
>
>%end;
>
>%else %do;
>%let subj=OK;
>%end;
>
>
>%mend checkerrors;
>
>%checkerrors;
>American Express made the following
> annotations on 12/19/06, 03:33:08
>------------------------------------------------------------------------------
>******************************************************************************
>
>"This message and any attachments are solely for the intended recipient and
may contain confidential or privileged information. If you are not the
intended recipient, any disclosure, copying, use, or distribution of the
information included in this message and any attachments is prohibited. If
you have received this communication in error, please notify us by reply
e-mail and immediately and permanently delete this message and any
attachments. Thank you."
>
>American Express a ajout� le commentaire suivant le 12/19/06, 03:33:08
>
>Ce courrier et toute pi�ce jointe qu'il contient sont r�serv�s au seul
destinataire indiqu� et peuvent renfermer des renseignements confidentiels
et privil�gi�s. Si vous n'�tes pas le destinataire pr�vu, toute divulgation,
duplication, utilisation ou distribution du courrier ou de toute pi�ce
jointe est interdite. Si vous avez re�u cette communication par erreur,
veuillez nous en aviser par courrier et d�truire imm�diatement le courrier
et les pi�ces jointes. Merci.
>******************************************************************************
> =============================================================================
|