Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is this valid

Status
Not open for further replies.

JebusRocks

Programmer
Sep 14, 2004
30
CA
Hello all

I have a 88 level variable called X that is assigned the values 1 thru 9
I am wondering is the following IF statement a valid one?

IF X = 1 THRU 4 THEN
do something

I am wondering if the word thru is valid in this context?

Thanks in advance for any replies
 
try something like this:

Code:
EVALUATE X WHEN 1 THRU 4 do something ....

Regards,

Crox
 
No, I'm afraid it's not valid (at least not on any compiler I'm familiar with). You can use an abbreviated relational condition:
Code:
IF X>0 AND <5
You can also use:
Code:
EVALUATE X
  WHEN 1 THRU 4
...
END-EVALUATE

Regards.

Glenn
 
OOPS! Just realized you mentioned an 88-level. The THRU keyword is valid on the 88-level itself, but not on the IF. E.g.:
Code:
01  WS-SOME-VALUE    PIC 9.
    88  X            VALUE IS 1 THRU 4.
...
IF X 
   do something

Glenn
 
Hi Jebus,

Hope you're still there. If you need X as "1 thru 9" for other uses in the pgm, just define another 88 as
"Y VALUE 1 thru 4" and test for Y as Glenn suggested for X.

Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top