Date: Mon, 31 Mar 2008 18:25:39 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Macro question
In-Reply-To: <OFF752C4C9.A4D6B3BD-ON8625741D.006468D0-8625741D.0064ADDF@fd9ns01.okladot.state.ok.us>
Content-Type: text/plain; charset="iso-8859-1"
call execute( '%test(' || Put( _N_ , Best12. ) || ')' ) ;
Toby Dunn
"Don't bail. The best gold is at the bottom of barrels of crap."
Randy Pausch
"Be prepared. Luck is where preparation meets opportunity."
Randy Pausch
> Date: Mon, 31 Mar 2008 13:21:45 -0500
> From: mpajoh@ODOT.ORG
> Subject: Re: Macro question
> To: SAS-L@LISTSERV.UGA.EDU
>
> OK, but I do not know how to do that.
> Any hints?
>
>
>
>
>
> toby dunn
> 03/31/2008 01:15 PM
>
> To
> ,
> cc
>
> Subject
> RE: Macro question
>
>
>
>
>
>
> _N_ is a numeric and you havent told SAS in your call execuet statement
> how to convert it, so it does an automatic conversion for you to a
> character value.
>
> Toby Dunn
>
> "Don't bail. The best gold is at the bottom of barrels of crap."
> Randy Pausch
>
> "Be prepared. Luck is where preparation meets opportunity."
> Randy Pausch
>
>
>> Date: Mon, 31 Mar 2008 13:09:22 -0500
>> From: mpajoh@ODOT.ORG
>> Subject: Macro question
>> To: SAS-L@LISTSERV.UGA.EDU
>>
>> The following:
>> %macro test(nn);
>> %if ( mod(&nn.,2)!=0 ) %then %put "&nn is an odd number";
>> %mend test;
>>
>> data a;
>> do i=1 to 20; output; end;
>> run;
>> data _null_;
>> set a;
>> call execute('%test('|| _N_ ||');');
>> run;
>>
>> returns:
>> NOTE: Numeric values have been converted to character values at the
> places
>> given by: (Line):(Column).
>> 52:29
>> ERROR: Required operator not found in expression: ( mod(&nn.,2)!=0 )
>> .
>> .
>> .
>> why?
>>
>> Masoud
>
> Test your Star IQ Play now!
_________________________________________________________________
How well do you know your celebrity gossip?
http://originals.msn.com/thebigdebate?ocid=T002MSN03N0707A
|