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 (May 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 6 May 2002 10:23:29 -0400
Reply-To:     Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject:      Re: Macro problem
Content-Type: text/plain; charset=ISO-8859-1

On Mon, 6 May 2002 06:48:07 -0700, jordi <jordicantoni@MENTA.NET> wrote:

>Hi all, >I´m doing this simple macro > > >%macro talla(var,esquerr,dreta,XXXXXX); >data b5; > set kk; > if &var < &esquerr or &var>&dreta then q=1; > if &var in (.,9999) then q=2;; > if q=1 then msg='XXXXXX fuera de rango, ' || trim(left(&var))|| ' Kg > pag.6 paciente ' || trim(left(cod_pac))|| ' centro ' || >trim(left(cod_cen))|| ' '; > if q=2 then msg='Variable XXXXXXX missing, confirmar dato paciente ' >|| trim(left(cod_pac))|| ' centro ' || trim(left(cod_cen))|| ''; >if q=1 or q=2; >keep cod_pac cod_cen &var msg talla; >run; >%mend talla; > > >I want put a text in XXXXXX on first statment and can see this text in >varible msg, >Is this posible?? >Thnaks in advance > >Jordi Cantoni

I'm not sure if I understand that right, but: for sure it is possible to pass a text parameter to a macro: %talla(1,2,3,test); Your parameter name (the macro variable you've choosen) is &XXXXXX (not too nice, but if you like it...) To get it in the Variable msg, you have to choose the " instead of '

msg=" some text &XXXXXX other Text...";

that's all.


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