move alphanumeric data from LARGER sending size to SMALLER receiving size

Program to move the alphanumeric data from LARGER sending size to SMALLER receiving size

IDENTIFICATION DIVISION.
PROGRAM-ID. PGM6.
AUTHOR. Indus Computer Services.
*WHEN THE RECIEVE SIZE IS SMALLER.
*TRUNCATION OCCURS FROM THE RIGHT IN ALPHA.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 A PIC X(5) VALUE 'HELLO'.
77 B PIC X(4) VALUE SPACES.
PROCEDURE DIVISION.

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

0 comments:

Post a Comment