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 (November 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 6 Nov 2005 14:05:26 -0800
Reply-To:   shiling99@YAHOO.COM
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   shiling99@YAHOO.COM
Organization:   http://groups.google.com
Subject:   Re: using macro to assign a Global Variable by condition
Comments:   To: sas-l@uga.edu
In-Reply-To:   <1131140678.221175.310640@g47g2000cwa.googlegroups.com>
Content-Type:   text/plain; charset="iso-8859-1"

For the information you provide, it may be a good idea to a macro as a function form. When it is called it returns a value. Be careful to define Global macro var when you have a complicated program. Defining Global macro vars as needed is always a good idea.

Here is an example.

54 %macro props(sp); 55 %if &sp.=AB %then 60; 56 %if &sp.=CD %then 36; 57 %mend props; 58 59 60 ***Program: test.mac; 61 62 63 %put >>>%props(AB)<<; >>>60<< 64 %put >>>%props(CD)<<; >>>36<<


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