Date: Mon, 6 Jun 2005 13:19:30 -0400
Reply-To: Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject: Re: A simple question and error for using MACRO variable
On Mon, 6 Jun 2005 12:39:02 -0400, Fred <ieaggie2002@GMAIL.COM> wrote:
>Hi, I have the following code and always got an error:
>
> %let prediction_interval = 6;
> %let i = 6;
> PROC STATESPACE DATA=Demand
> OUT=F4(RENAME=(FOR1=FCST_STATE))
> LEAD=&prediction_interval + &i;
> VAR Demand PCA1 PCA4;
> ID t;
> RUN;
>
>The error message is:
>1893 PROC STATESPACE DATA=Demand
>1894 OUT=F4(RENAME=(FOR1=FCST_STATE))
>1894! LEAD=&prediction_inteval + &i;
> -
> 22
>WARNING: Apparent symbolic reference PREDICTION_INTEVAL not resolved.
>1894 &prediction_inteval + &i;
> ------------------ -
> 202 22
>ERROR: Invalid number conversion on ;.
>ERROR: Invalid number conversion on ;.
>ERROR 22-322: Expecting an integer constant.
>ERROR 202-322: The option or parameter is not recognized and will be ignored.
>
>
>Can anybody give me some advice how to correct this error?
Hi, Fred,
I wonder if the following would solve your problem.
Cheers,
Chang
OLD> LEAD=&prediction_interval + &i;
NEW> LEAD=%eval(&prediction_interval + &i);
|