Re: Report enhancements

From: Robert Wagner (spamblocker-robert_at_wagner.net)
Date: 11/01/04


Date: Mon, 01 Nov 2004 08:35:21 GMT

On Thu, 28 Oct 2004 15:08:50 -0700, "Chuck Stevens"
<charles.stevens@unisys.com> wrote:

>Robert Wagner wrote:

>> While we're on the subject, it seems asymmetrical that we can say SET
>> CONDITION-1 TO FALSE but cannot say
>>
>> 01 PIC X VALUE FALSE.
>> 88 CONDITION-1 VALUES 'A' 'B' 'C' FALSE 'D'.
>
>I think you've misunderstood. VALUE FALSE applies *only* to 88's, and the
>filler isn't an 88.

A SET statement puts a value into the filler. A VALUE clause likewise
puts a value into the filler.

>I see no inconsistency. *ALL* the values save 'A', 'B' and 'C' would result
>in CONDITION-1 being FALSE; there may be any number of FALSE values. There
>may be only one such value to which the parent item is set *when* you SET
>the condition to FALSE. "VALUE FALSE" is unnecessary as well as
>meaningless on the PIC X item.

All VALUEs are unnecessary. Fields could be initialized with
procedural code. But values are good documentation when used in
copybooks and with INTIIALIZE TO VALUE. Is there a good reason to
exclude fields with 88?

>> When the value of false changes to 'E', we must change 01 VALUE as
>> well as 88 VALUES. That's contrary to the spirit of 88s.
>
>'E' is but one of probably 253 values for the PIC X item that would cause
>CONDITION-1 to be FALSE. VALUE FALSE has nothing to do with the value that
>RESULTS in FALSE, it only specifies which value is used when it is
>EXPLICITLY SET to FALSE.

Why can't VALUE use the same value as SET in the way other VALUEs use
the same value as MOVE?

>> Examples follow. Please explain how we can do this with '02 features.
>
>Easy.
>
>Method 1: Use >>DEFINE I-AM-DEBUGGING at the beginning of the program and
>>>IF I-AM-DEBUGGING... >> END-IF pairs around the IFs and END-IFs. Maybe
>not quite as elegant as your examples, but functional.
>
>Method 2:
>
> D77 PIC 9 VALUE 1.
> D88 ITS-TRUE VALUE 1.
> D88 ITS-FALSE VALUE 0.
>
> D OR ITS-TRUE ...
> D AND ITS-FALSE ...

If that's a good debugging solution then 'perform forever' is already
at hand:

PERFORM UNTIL ITS-FALSE