06-10-2013 04:32 PM
I did this below. What I'd like is to create a table where the prompt (TEXT) gets for values a where statement. Values are WHERE PERFORMING_FLAG = "Yes" , it display "Yes" to the user, and WHERE PERFORMING_FLAG = "No" that displays "No" to the user, and /* */ which displays "All"
So I wrote the code below, and it doesn't work.
What I want is being able To make the user choose between two options that are WHERE statement and one option that is nothing (so no WHERE statement).
How should I do my prompt or correct the code ? The prompt is &PERFORMING_FLAG
Or I guess there is a possibility to make it more clear, could be you please enlighten me ?
CREATE TABLE TRAVAIL.Q113_INPUTS AS
t1.'Lb Secteur EIS GB'n,
t1.'Type Encours GB'n,
t1.'LB Pays Resp'n,
t1.'Lib Metier 25'n,
t1.'Lib act agg 25'n,
FROM TRAVAIL.Q113_INPUTS_1 t1
06-11-2013 07:41 AM
Can you please share how you have created the Macro Variable &PERFORMING_FLAG. ???
If you want WHERE statement as a value of Macro Variable to be solved in Proc Sql, then you need to quote the value like this...
%let PERFORMING_FLAG_YES = %str(where performing_flag = "yes");
%let PERFORMING_FLAG_NO = %str(where performing_flag ; "No");
A part from that, also check for case sesitivity in your data...Like How "Yes" and "No" are coded...Whether it is propcase,upcase or lowcase...Accordingly store the values in Macro Variables...
Hope it helps
06-11-2013 07:41 AM
If I've understood you correctly, you already know how to set up macro variable PERFORMING_FLAG as either:
WHERE PERFORMING_FLAG = "Yes"
WHERE PERFORMING_FLAG = "No"
but you would also like to set it up to pick up all records. This can be done by setting it, for example, to:
which will be true for all records, or just set the macro variable PERFORMING_FLAG to blank so that no where clause is applied.
If this does not fit with what you are trying to do then please explain further, also showing what code you are using to create macro variable PERFORMING_FLAG.