Redefinition of COMPUTATIONAL or COMPUTATIONAL-6 Data Items

Solution:

MOVE the data items concerned to other data items which are not defined as COMPUTATIONAL or COMPUTATIONAL-6. Moving these data items converts the data automatically, overcoming any problems you might have had.

Example:

The following source code is coded to take advantage of the internal representation of COMPUTATIONAL-6 data items under the RM/COBOL system, and to analyze a date field:

 01 birthdate-1          pic 9(6) comp-6. 
 01 birthdate-2 redefines birthdate-1. 
     03 month-2         pic 99 comp-6. 
     03 day-2           pic 99 comp-6. 
     03 year-2          pic 99 comp-6. 
     ....

 procedure division. 
 start-up section. 
 para-1. 
     ....

     move 082462 to birthdate-1. 
     ....

     if year-2 = 62 
         display "records not available for 1962."

Amend your source program to use the DISPLAY format instead of redefining COMPUTATIONAL-6 data items, before submitting it to this COBOL system:

 01 birthdate-1          pic 9(6) comp-6. 
 01 birthdate-2 redefines birthdate-1. 
     03 month-2         pic 99 comp-6. 
     03 day-2           pic 99 comp-6. 
     03 year-2          pic 99 comp-6.

 01 birthdate-1a         pic 9(6). 
 01 birthdate-2a redefines birthdate-1a. 
     03 month-2a        pic 99. 
     03 day-2a          pic 99. 
     03 year-2a         pic 99. 
     ....

 procedure division. 
 start-up section. 
 para-1. 
     ....

     move 082462 to birthdate-1. 
     move birthdate-1 to birthdate-1a. 
     ....

     if year-2a = 62 
         display "records not available for 1962."