Top
NetCOBOL V11.0 Syntax Samples
FUJITSU Software

1.27 REDEFINES Clause

The REDEFINES clause is used to redefine data items.

The REDEFINES clause is used to reference a specific item using a different item definition or to assign a different role to one data area.

000010 @OPTIONS MAIN
000020*----------------------------------------------------------------------
000030* The REDEFINES clause is used to redefine items.
000040*----------------------------------------------------------------------
000050 IDENTIFICATION   DIVISION.
000060 PROGRAM-ID.      SAMPLE.
000070 DATA             DIVISION.
000080 WORKING-STORAGE  SECTION.
000090*----------------------------------------------------------------------
000100* The name of the item to be redefined is specified in the REDEFINES 
000110* clause.
000120* The attribute of the item to be redefined can be different from the 
000122* attribute of the item that is redefined.  However, take the internal 
000124* format into consideration when using the REDEFINES clause so that the
000126* new attributes make sense.
000130*----------------------------------------------------------------------
000140 01 IN-CHAR       PIC X(1).
000150 01 BOOL          REDEFINES IN-CHAR PIC 1(8) BIT.
000160*----------------------------------------------------------------------
000170 PROCEDURE        DIVISION.
000180     DISPLAY "The input character is displayed in bit expression."
000190     DISPLAY "Please input a character (one character). >>" 
000195             WITH NO ADVANCING.
000200     ACCEPT IN-CHAR.
000210     DISPLAY "The bit expression of character """ IN-CHAR 
000215             """ is " BOOL ".".
000220 END PROGRAM SAMPLE.