|
From: John R. C. <jo...@we...> - 2005-08-19 12:09:18
|
On Friday 19 August 2005 07:50 am, Jim Morcombe wrote:
> Here is another cut down listing.
>
> It demonstrates what I believe to be a bug in the compiler concerning
> the EVALUATE statement.
>
> When I compile it, I get the following error message:
>
> jim.cbl: 18: error: incompatible selection object, on or before '='
>
> Jim
>
> IDENTIFICATION DIVISION.
> 2 000300 PROGRAM-ID. rgmssch.
> 3 001200 ENVIRONMENT DIVISION.
> 4 001700
> 5 001900 DATA DIVISION.
> 6 002100 FILE SECTION.
> 7 002300
> 8 002500 WORKING-STORAGE SECTION.
> 9
> 10 01 LICENCE-DAYS PIC 9(5).
> 11
> 12
> 13
> 14 019500 PROCEDURE DIVISION.
> 15 020200 MAINLINE.
> 16
> 17 EVALUATE TRUE
> 18 WHEN LICENCE-DAYS = ZERO
> 19 CONTINUE
> 20 END-EVALUATE.
I am not familiar with such a construct. According to the books
I have, (three at the moment) you EVALUATE FIELDNAME.
And then the following WHEN statements are equivalent to
IF FIELDNAME = (value) (executable statement)
ELSE IF....
The EVALUATE TRUE statement in your program does not refer to a field name
but a condition-name. This in turn requires a level 88 appended
to a field name in e.g., WORKING STORAGE.
CONTINUE is used in an IF statement. I have not found it used in
a EVALUATE statement.
TRUE is not a field but a condition name attributed to a field
that has an 88 statement like:
O1 WS-ANOTHER-RECORD PICTURE X.
88 ANOTHER-RECORD VALUE "Y" FALSE "N".
EVALUATE with WHEN statements is an alternative to the use of IF with
condition
names. Don't mix the two.
--
John Culleton
Books with answers to marketing and publishing questions:
http://wexfordpress.com/tex/shortlist.pdf
Book coaches, consultants and packagers:
http://wexfordpress.com/tex/packagers.pdf
|