INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Variable Filtering Not Working

Variable Filtering Not Working

(OP)
I have a report in which I created a WHERE clause for a flag column (contains a 1 if true, 0 if false).  The flag value is generated in the master file using the following logic:

DEFINE DISABLED/A20=IF NSACCOUNTLOCK EQ 'true' THEN '1' ELSE '0'; $

The WHERE clause in my FEX is as follows:

( AD_HOC.ROOT.DISABLED EQ &DISABLED )

When I run my report, I'm prompted to enter a value for &DISABLED.  No matter what value I enter, both 1's and 0's appear in the DISABLED field of my report.  Am I doing something wrong?

For further detail into my setup, I have two different master files that pull in the same fields.  In my FEX, I'm combining their output using MORE.  Originally I had 9 flag fields and using AND statements in my WHERE clause, attempted to filter based on selection criteria from the user.  After it failed to work I pared it down to just one, and am having the same issue.

 

RE: Variable Filtering Not Working

jcollier3

It has been a long time since I worked with FOCUS, but I see a couple of items you might want to change...

The field/flag: DISABLED is defined as A20 - if it is only going to be a 0 or 1, define it as A01 or Numeric.

Also the variable &DISABLED - you might try changing the variable to a global variable: &&DISABLED  - note double ampersand.

Hope that helps.

RE: Variable Filtering Not Working

jcollier3,

Also DISABLED might be a reserved word (need to check this).

DEFINE FILE <FILENAME> CLEAR
 DIS_FLAG /I1 = IF ((UPCASE(NSACCOUNTLOCK) EQ 'TRUE') THEN 1 ELSE IF ((UPCASE(NSACCOUNTLOCK) EQ 'FALSE') THEN 0
 ELSE 2;
END

TABLE FILE <FILENAME>
 

 WHERE (DIS_FLAG EQ '&DIS_FLAG')
END

With this you can either get the program to ask you for the prompt or you can set a -DEFAULT for &DIS_FLAG set to 2 as default and the program that you get to run this will pick all records, unless you provide a variable when running the fex.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close