HP3000-L Archives

September 2000, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Duane Percox <[log in to unmask]>
Reply To:
Duane Percox <[log in to unmask]>
Date:
Fri, 1 Sep 2000 11:54:13 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (72 lines)
Mark,

I'm not sure why you would think it *odd* when
your use of the end-compute wasn't correct for
what you intended.

What you coded would compile because it is correct
syntax. What you coded would not work because it
is incorrect in logic in that your end-compute that
you thought was terminating the original compute actually
terminates the compute withing the on size error clause.

You could also solve it by adding another end-compute which
would then match-up the compute/end-compute the way you
were expecting.

Duane Percox    wk: 650.372.0200x608  fax: 650.372.3386
[log in to unmask]
www.qss.com
qwebs.qss.com


 -----Original Message-----
 From: Mark Boyd [mailto:[log in to unmask]]
 Sent: Friday, September 01, 2000 11:21 AM
 To: [log in to unmask]
 Subject: Re: [HP3000-L] Cobol, IF on size error question


 Well it worked, it strikes me as odd, but it worked.  Thanks.
 But that begs the question, how many programs do we have
 merrily bouncing
 around to the wrong statements because of this?

 -----Original Message-----
 From: Duane Percox [mailto:[log in to unmask]]
 Sent: Friday, September 01, 2000 10:58 AM
 To: [log in to unmask]
 Subject: Re: [HP3000-L] Cobol, IF on size error question

 Mark - any scope terminator terminates scope to the
 most previous initiation of the scope in question.

 So, if inside a compute/end-compute don't use another
 compute within your on-size-error.

 Change

             COMPUTE WS-WEIGHT-PCT =
  +4                (WS-ITEM-WEIGHT * 100) / WS-LEVEL-WEIGHT
  +5         ON SIZE ERROR
  +6            COMPUTE WS-WEIGHT-PCT = 0
  +7         END-COMPUTE
  +8         COMPUTE WS-PNH =
  +9                 FOB-AMT(1) * WS-WEIGHT-PCT / 100
  10         END-COMPUTE

 to
             COMPUTE WS-WEIGHT-PCT =
  +4                (WS-ITEM-WEIGHT * 100) / WS-LEVEL-WEIGHT
  +5         ON SIZE ERROR
  +6            MOVE ZERO TO WS-WEIGHT-PCT
  +7         END-COMPUTE
  +8         COMPUTE WS-PNH =
  +9                 FOB-AMT(1) * WS-WEIGHT-PCT / 100
  10         END-COMPUTE

 Duane Percox    wk: 650.372.0200x608  fax: 650.372.3386
 [log in to unmask]
 www.qss.com
 qwebs.qss.com

ATOM RSS1 RSS2