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 (June 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 16 Jun 2005 14:15:29 -0700
Reply-To:     Mark <joystar.jin@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mark <joystar.jin@GMAIL.COM>
Organization: http://groups.google.com
Subject:      How to covert macro variable to number and assign back to macro
              variable
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset="iso-8859-1"

I need to pass a month variable into my macro. Then I want to convert it to number, and increase it by 200.

Say if the value is 200405, then after pass in into macro I want to get 200605 and assign it to a new macro variable.

%macro test(MONTH) m=&MONTH; %mend test;

For instance, in above code, &MONTH contain value of 200405. I want to get 200605(200405+200) and assign it to a new macro variable(&MONTH_NEW).

Thanks,

Matt


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