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 17:20:56 -0400
Reply-To:     harry.droogendyk@RBC.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Harry Droogendyk <harry.droogendyk@RBC.COM>
Subject:      Re: How to covert macro variable to number and assign back to
              macro variable
Content-Type: text/plain; charset="iso-8859-1"

%let month_new = %eval(&month + 200);

-----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]On Behalf Of Mark Sent: Thursday, June 16, 2005 5:15 PM To: sas-l@uga.edu Subject: How to covert macro variable to number and assign back to macro variable

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 __________________________________________________________________________________________________________________________________

This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.

Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.


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