Move numericdata from larger sending size to smaller receiving size

Program to move the numeric data from larger sending size to smaller receiving size

IDENTIFICATION DIVISION.
PROGRAM-ID. PGM5.
AUTHOR. Indus Computer Services.
*WHEN THE RECIEVE SIZE IS SMALLER.
*TRUNCATION OCCURS FROM THE LEFT IN NUMERIC
*TRUNCATION OCCURS FROM THE RIGHT IN DECIMAL
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 A PIC 99V99 VALUE 34.56.
77 B PIC 9V9 VALUE ZERO.
PROCEDURE DIVISION.

MOVE A TO B.
DISPLAY 'RECIEVE SIZE IS SMALLER'.
DISPLAY 'TRUNCATION OCCURS FROM THE LEFT AND RIGHT : ' B.
STOP RUN.

0 comments:

Post a Comment