Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
6-67
DIVIDE Statements
dividend
is the identifier of an elementary numeric data item that is the dividend and
receiving field for the quotient.
DIVIDE GIVING Statement
The DIVIDE GIVING statement divides one data item into another and stores the
quotient in one or more data items.
divisor
is either a numeric literal or the identifier of an elementary numeric data item.
dividend
is either a numeric literal or the identifier of an elementary numeric data item.
quotient
is the identifier of an elementary numeric data item where the quotient is stored.
DIVIDE BY GIVING Statement
The DIVIDE BY GIVING statement is the same as DIVIDE GIVING, except the
dividend is specified first.
dividend
is either a numeric literal or the identifier of an elementary numeric data item.
divisor
is either a numeric literal or the identifier of an elementary numeric data item.
quotient
is the identifier of an elementary numeric item where the quotient is stored.
The following example illustrates the DIVIDE BY GIVING statement:
WORKING-STORAGE SECTION.
77 leap-year PIC 9 VALUE ZERO.
77 divide-result PIC 99 VALUE ZERO.
01 invoice-date.
05 inv-month PIC 99.
05 inv-day PIC 99.
05 inv-year PIC 99.
:
DIVIDE
divisor
INTO
dividend
GIVING {
quotient
} ,...
DIVIDE
dividend
BY
divisor
GIVING {
quotient
} ,...










