Subject: | |
From: | |
Reply To: | |
Date: | Wed, 6 Sep 2000 09:23:53 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Thanks. I figured that out a little too late. I should of called in
stupid that day and stayed home.
-----Original Message-----
From: Ric Merz [mailto:[log in to unmask]]
Sent: Tuesday, September 05, 2000 10:09 PM
To: [log in to unmask]
Subject: Re: [HP3000-L] Cobol, IF on size error question
Mark,
This is a classic example of incorrect "white space". Of course the
computer ignores white space and just matches up begin/end pairs (as per
Duane's example). Your code actually looks like this:
DISPLAY THIS CODE IN A COURIER FONT (I hope it displays as I intend it to!)
--------------- begin code --------------------
MOVE "YES" TO FREIGHT-PRORATED
IF PRORATE-FREIGHT
COMPUTE WS-WEIGHT-PCT =
(WS-ITEM-WEIGHT * 100) / WS-LEVEL-WEIGHT
ON SIZE ERROR
COMPUTE WS-WEIGHT-PCT = 0
END-COMPUTE
COMPUTE WS-PNH =
FOB-AMT(1) * WS-WEIGHT-PCT / 100
END-COMPUTE
ELSE
IF FOB-AMT(3) <= LS-EXT-PRICE
COMPUTE WS-PNH = FOB-AMT(1)
ELSE
COMPUTE WS-PNH = 0
END-IF
END-IF.
--------------- end code ----------------------
Which is why it jumps to the end-if. The other two computes are only
executed when there is an "on size error".
Ric
>-8 PROCESS-THE-1X-RECORD.
>-7
>-6 IF FOB-AMT(3) = 0
>-5 COMPUTE WS-TAX = 0
>-4 ELSE
>-3 COMPUTE WS-TAX ROUNDED =
>-2 (FOB-AMT(2) / FOB-AMT(3)) * LS-EXT-PRICE
>-1 END-IF.
> *
>+1 MOVE "YES" TO FREIGHT-PRORATED
>+2 IF PRORATE-FREIGHT
>+3 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
>11 ELSE
>12 IF FOB-AMT(3) <= LS-EXT-PRICE
>13 COMPUTE WS-PNH = FOB-AMT(1)
>14 ELSE
>15 COMPUTE WS-PNH = 0
>16 END-IF
>17 END-IF.
>18
>
Ric
[log in to unmask]
|
|
|