Jump to content

I have a set statement with several codes that I want to exc...


Howell Johnson 2

Recommended Posts

I have a set statement with several codes that I want to exclude if I choose Y and include if I choose N. However, the report always excludes the codes regardless of choosing Y or N. The code I am using is below. It appears that my Where statement is not being populated with FOC_NONE.

-DEFAULTH &PMF = Y;

-SET &PMF1= IF &PMF EQ Y THEN M130 ELSE FOC_NONE;

-SET &PMF2= IF &PMF EQ Y THEN M131 ELSE FOC_NONE;

-SET &PMF3= IF &PMF EQ Y THEN M132 ELSE FOC_NONE;

-SET &PMF4= IF &PMF EQ Y THEN M135 ELSE FOC_NONE;

-SET &PMF5= IF &PMF EQ Y THEN M140 ELSE FOC_NONE;

WHERE SHIPTO_ADHOC_BV.COMMON_PRODUCT_ATTRIBUTES.SKU OMITS &PMF1 OR &PMF2 OR &PMF3 OR &PMF4 OR &PMF5;

Link to comment
Share on other sites

Hi Howell,

FOC_NONE causes the line of code to be ignored, as if that line were blank.

The line need not be a WHERE phrase.

For example, it can be employed to eliminate a BY clause or a Verb Object.

_FOC_NULL forces a WHERE condition to evaluate as True, regardless of the incoming data values.

So, try with _FOC_NULL instead.

Link to comment
Share on other sites

WHERE SHIPTO_ADHOC_BV.COMMON_PRODUCT_ATTRIBUTES.SKU OMITS &PMF1 OR &PMF2 OR &PMF3 OR &PMF4 OR &PMF5;

FOC_NONE might work if you broke it up line by line like

WHERE SHIPTO_ADHOC_BV.COMMON_PRODUCT_ATTRIBUTES.SKU OMITS &PMF1

OR &PMF2

OR &PMF3

OR &PMF4

OR &PMF5

;

As long as you always have that first value &PMF1. I have used this in other queries with the important part being that the FOC_NONE only eliminates items related to a single line(in this case the OR and variable). Note that the semicolon is on its own line.

Link to comment
Share on other sites

Yes &PMF is set to Y. I tried using _FOC_NULL and that works. I also tested FOC_NONE and placed the &PMF on separate rows like in Todds example but that only works when I select Y When I select N the report doesnt pull any results. Martin your example looks interesting and I will definitely try this on future reports. Thanks to all for the quick response and help.

I agree I think most coders have been working with WF for a while.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...