Hi there
I am having problems using prompts in EG. I want to specify an if statement to do one of two things depending on a prompt. The prompt will be either "MPANlist" or "Portfolio".
Plesae see code below. When I change the first line from "Portfolio" to "MPANlist" sas still ruuns the second if statement (which is for the prompt value"Portfolio")
Please Help!
%let Process = "Portfolio";
%macro Choose_Process;
%if $Process = "MPANList" %then %do;
PROC SQL;
CREATE TABLE WORK.Voltage_ID AS
SELECT t1.MPANCORE2,
t1.LLF,
t2.Voltage_ID,
t1.Dist_ID2
FROM MPAN_IMPORT_DIST_ID_FORMAT AS t1, WORK.TX920_LOSSES_LOOKUP_FORMAT AS t2
WHERE (t1.LLF = t2.LLF AND t1.Dist_ID2 = t2.DIST_ID);
quit;
%end;
%else %if &Process = "Portfolio" %then %do;
PROC SQL;
CREATE TABLE WORK.Voltage_ID AS
SELECT t1.MPANCORE,
t1.Dist_ID2,
t1.LLF2,
t2.Voltage_ID as TEST
FROM WORK.CALC_DIST_ID_FORMAT AS t1, WORK.TX920_LOSSES_LOOKUP_FORMAT AS t2
WHERE (t1.LLF2 = t2.LLF AND t1.Dist_ID2 = t2.DIST_ID);
QUIT;
%end;
%mend Choose_Process;
%Choose_Process
Run;