Are you setting the items you want to check against to a variable first?
SET VAR vck TEXT = NULL
SELECT listof(your list) into vck INDIC ivck FROM wherever
IF vhumpty NOT IN .vck THEN

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Bruce A.
Chitiea
Sent: Friday, July 26, 2013 12:15 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - SELECT not allowed within IF statement

All:

What I need to do is test a variable against a list of values within an
IF statement.

This works:

      IF vHumpty NOT IN +
      ('JAN','FEB','MAR', ... 'DEC') THEN

I'd rather avoid hard-coding the values; preferring to pull values
dynamically.

All the following attempts fail, producing this error message:

      '-ERROR- Sub-SELECTs are not supported by this command. (2310)'

This fails:

      IF vHumpty NOT IN +
      (SELECT CalMonthAbbr FROM zMonth) THEN

As does this:

      SET VAR vDumpty TEXT =  +
      '(SELECT CalmonthAbbr FROM zMonth)'

      IF vHumpty NOT IN + 
      &vDumpty THEN

As does this:

      SET VAR vGrimmBros TEXT = +
      '(SELECT CalMonthAbbr FROM zMonth)

      SET VAR vDumpty TEXT = .vGrimmBros

      IF vHumpty NOT IN +
      &vDumpty THEN

It must be real simple. I'm just not seeing it.

TIA

Bruce


Reply via email to