gmupatsfan
Technical User
Here's my code -- I'm getting too many errors to list.
400-TYPE-RTN.
IF IR-MILES <=300 MULTIPLY IR-MILES BY .12 GIVING WS-MILECHRG
MULTIPLY 15 BY CR-DAYS GIVING WS-TOTALCHRG
ELSE
SUBTRACT 300 FROM CR-MILES GIVING WS-DIFFERENCE
MULTIPLY WS-DIFFERENCE BY .10 GIVING WS-TYPEAMT1
MULTIPLY 300 BY .12 GIVING WS-TYPE3AMT
ADD WS-TYPE3AMT TO WS-TYPE3BAMT GIVING WS-MILECHRG
(if it's below 300 then the person is charged x amt of $; if its over 300 the person gets charged y amt of $ for everything over 300.
Basically, my question is are all of those statements legal in COBOL? Can you have multiple statements like that in an IF ELSE
Thank you for any help!
400-TYPE-RTN.
IF IR-MILES <=300 MULTIPLY IR-MILES BY .12 GIVING WS-MILECHRG
MULTIPLY 15 BY CR-DAYS GIVING WS-TOTALCHRG
ELSE
SUBTRACT 300 FROM CR-MILES GIVING WS-DIFFERENCE
MULTIPLY WS-DIFFERENCE BY .10 GIVING WS-TYPEAMT1
MULTIPLY 300 BY .12 GIVING WS-TYPE3AMT
ADD WS-TYPE3AMT TO WS-TYPE3BAMT GIVING WS-MILECHRG
(if it's below 300 then the person is charged x amt of $; if its over 300 the person gets charged y amt of $ for everything over 300.
Basically, my question is are all of those statements legal in COBOL? Can you have multiple statements like that in an IF ELSE
Thank you for any help!