OBNOL算术运算拥有以下几种方法: COMPUTE, ADD, SUBTRACT, MULTIPLY, 和 DIVIDE 语句子 数字内置函数 言语环境中却调用的效力动

  4.4.1 算术语句子 COMPTE语句子把表臻式的值赋给壹个或多个数据项。用COMPUTE语句子却以轻松的把算术操干构成在壹道,而不受ADD,SUBSTRACT, MULTIPLY, 和 DIVIDE语句子这么的结实寄存放限度局限。

  4.4.1.1 ADD语句子 ADD 语法1:

  ADD identifier-1,identifier-2,… TO identifier-n [ROUNDED]

  [ON SIZE ERROR statement-1]

  [NOT ON SIZE ERROR statement-2]

  [END-ADD]

  例儿子:

  ADD NUM1 TO NUM2.

  ADD NUM1, 10 TO NUM2.

  ADD NUM1, NUM2 TO NUM3 ON SIZE ERROR PERFORM 100-ERROR.

  ADD 语法2:

  ADD identifier-1,identifier-2,… [TO] identifier-n GIVING identifier-m [ROUNDED]

  [ON SIZE ERROR statement-1]

  [NOT ON SIZE ERROR statement-2]

  [END-ADD]

  例儿子:

  ADD NUM1 TO NUM2 GIVING NUM3.

  ADD NUM1, NUM2 GIVING NUM3.

  ADD NUM1, 10 TO NUM2 GIVING NUM3.

  ADD 语法3:

  ADD CORR identifier-1 TO identifier-2 [ROUNDED]

  [ON SIZE ERROR statement-1

  [NOT ON SIZE ERROR statement-2] [END-ADD]

  例儿子:

  03 CURRENT-MONTH.

  05 PAY PIC 9(3)V9(2).

  05 TAX PIC 9(2)V9(2).

  03 YTD.

  05 PAY PIC 9(3)V9(2).

  05 TAX PIC 9(2)V9(2).

  ADD CORR CURRENT-MONTH TO YTD.

  4.4.1.2 SUBTRACT语句子 SUBTRACT 语法1:

  SUBTRACT identifier-1, identifier-2,… FROM identifier-n

  [ROUNDED]

  [ON SIZE ERROR statement-1

  [NOT ON SIZE ERROR statement-2]

  [END-SUBTRACT]

  例儿子:

  SUBTRACT NUM1 FROM NUM2.

  SUBTRACT 语法2:

  SUBTRACT identifier-1 identifier-2,… FROM identifier-n

  GIVING identifier-m [ROUNDED]

  [ON SIZE ERROR statement-1]

  [NOT ON SIZE ERROR statement-2]

  [END-SUBTRACT]

  例儿子:

  SUBTRACT NUM1 FROM NUM2 GIVING NUM3.

  SUBTRACT 语法3:

  SUBTRACT CORR identifier- 1 FROM identifier- 2

  [ROUNDED]

  [ON SIZE ERROR statement-1]

  [NOT ON SIZE ERROR statement-2]

  [END-SUBTRACT]

  例儿子:

  SUBTRACT CORR REC1 FROM REC2.

  4.4.1.3 MULTIPLY语句子 MULTIPLY 语法1:

  MULTIPLY identifier- 1 BY identifier-2

  [ROUNDED]

  [ON SIZE ERROR statement- 1]

  [NOT ON SIZE ERROR statement-2]

  [END-MULTIPLY]

  例儿子:

  MULTIPLY NUM1 BY NUM2.

1
【关闭】 【打印】     [责任编辑:admin]

版权声明:

凡注明来源为本网的所有文字、图片、音视频、美术设计和程序等作品,版权均属本网或相关权利人专属所有或持有所有。未经本网书面授权,不得进行一切形式的下载、转载或建立镜像。否则以侵权论,依法追究相关法律责任。