SAS EG で複数のプロンプト値のストアド プロセス コードを作成しようとしています。
PROC SQL;
CREATE TABLE rpt_fac_prd_schd AS
select rpt.fac_id,fac.fac_nm as facility_name, schd.prd_id, prd.prd_nm
, bid_price_dt , bid_price, Table_top
, Remaining_resource_count label='rem_res_ct' as rem_res_ct, bid_price_tm
, today()-Load_Dt as Days_out
from TD.bid_price_rpt rpt Left Join SSIN.fac fac ON rpt.fac_id=fac.onesrc_fac_id
Left Join SSIN.FAC_PRD_SCHD schd ON rpt.fac_id=schd.fac_id
and rpt.bid_price_dt=schd.schd_dt
Left Join SSIN.PRD prd ON schd.prd_id=prd.prd_id
/*where fac.Fac_Nm="&Fac_Nm" *//*If I use this it is selecting only first value enetered in the prompt*/
where fac.Fac_Nm =CASE when &Fac_Nm_COUNT = 1 then "&Fac_Nm"
else do i=1 to &Fac_Nm_COUNT;/*Value of &Fac_Nm_COUNT is number of values I selected for Fac_Nm prompt*/
"&&Fac_Nm&i" %end
and prd.prd_nm ="&Prd_Nm"
and calculated Days_Out Between &Days_out_str and &Days_out_end
and BID_PRICE_DT = "&arrival_dt"d
and BID_PRICE_TM Between "&arrival_str_tm"t and "&arrival_end_tm"t
Order by fac.fac_nm, prd.prd_nm, bid_price_dt, bid_price , Table_top desc
, Remaining_resource_count desc,bid_price_tm desc, Days_out desc;
QUIT;
しかし、次のエラーがスローされます...私が間違いを犯している場所、または他の方法がありますか???
ERROR:
else do i=1 to &Fac_Nm_COUNT;
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, '.', /, <, <=, <>, =, >, >=, AND, EQ, EQT, GE, GET, GT, GTT, LE, LET, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.
ERROR 76-322: Syntax error, statement will be ignored.