CICS VSAM Transparency for z/OS, Version 1.2


COBOL REDEFINES clause and PL/I pointer based structures

CICS® VT generates a DB2® column for every copybook field. If a field is redefined, a column is generated for the original field and the redefining field. To illustrate this, look at the following extract of a COBOL copybook:
05 ZONED-DEC-01               PIC 9(8)              .
05 CHAR-REDEF-L1 REDEFINES  ZONED-DEC-01 PIC X(8)   .
05 CHAR-REDEF-L2 REDEFINES    CHAR-REDEF-L1         .
   07 CHAR-REDEF-2X           PIC X(02)             .
   07 CHAR-REDEF-2Y           PIC X(06)             .
   07 CHAR-REDEF-L3 REDEFINES CHAR-REDEF-2Y         .
       09 CHAR-REDEF-3X       PIC X(02)             .
       09 CHAR-REDEF-3Y       PIC X(04)             .
       09 CHAR-REDEF-L4 REDEFINES CHAR-REDEF-3Y     .
          11 CHAR-REDEF-4X    PIC X(01)             .
          11 CHAR-REDEF-4Y    PIC X(03)             .
          11 CHAR-REDEF-L5 REDEFINES CHAR-REDEF-4Y  .
             13 CHAR-REDEF-5X PIC X(01)             .
             13 CHAR-REDEF-5Y PIC X(02)             .
The edit columns screen that CICS VT produces for this copybook is shown in Figure 1:
Figure 1. Edit column screen for redefined fields
 --------------------- CICS VT: Edit columns in TFILE04 ------- Row 15 from 36
Command ===> ________________________________________________ Scroll ===> CSR 
                                                                              
Commands: MAP  SAVE  PREVIEW  SUSPEND/RESUME  CHANGE/UNDO  SHOW               
Actions:  S Display, U Update, D Delete, I Insert            Status message / 
A Pos   Copybook field name / DB2 column name     Type Len   Exit      Pic Par
- ----- ----+----1----+----2----+----3----+----   ---- ----- -----------------
_ 63    ZONED-DEC-01                            +      8     Redefined field 1
        ZONED_DEC_01..................          +  DEC 8,0                    
_ 63    CHAR-REDEF-L1                           +      8     Redefined field 2
        CHAR_REDEF_L1.................          + CHAR 8                      
_ 63    CHAR-REDEF-2X                           +      2     Redefined field 2
        CHAR_REDEF_2X.................          + CHAR 2                      
_ 65    CHAR-REDEF-2Y                           +      6     Redefined field 3
        CHAR_REDEF_2Y.................          + CHAR 6                      
_ 65    CHAR-REDEF-3X                           +      2     Redefined field 3
        CHAR_REDEF_3X.................          + CHAR 2                      
_ 67    CHAR-REDEF-3Y                           +      4     Redefined field 4
        CHAR_REDEF_3Y.................          + CHAR 4                      
_ 67    CHAR-REDEF-4X                           +      1     Redefined field 4
        CHAR_REDEF_4X.................          + CHAR 1                      
_ 68    CHAR-REDEF-4Y                           +      3     Redefined field 5
        CHAR_REDEF_4Y.................          + CHAR 3                      
_ 68    CHAR-REDEF-5X                           +      1     Redefined field 5
        CHAR_REDEF_5X.................          + CHAR 1                      
_ 69    CHAR-REDEF-5Y                           +      2     Redefined field 5
        CHAR_REDEF_5Y.................          + CHAR 2                      
_ 71    DATE-DEC-02                             +      8     Redefined field 1
        DATE_DEC_02...................          +  DEC 8,0                    
_ 71    CHAR-REDEF-CC                           +      2     Redefined field 1
        CHAR_REDEF_CC.................          + CHAR 2                      
The screen shows that the column ZONED_DEC_01 which corresponds to the copybook field ZONED-DEC-01 is at position 63 in the VSAM record, has a length of 8 bytes, and has a status of Redefined field 1. The number to the right of the status field indicates the level number of the redefined field.

The column CHAR_REDEF_L1 also starts at position 63 and has a length of 8 bytes, but the level number is 2. This is because it is also redefined, and the redefining fields correspond to columns CHAR_REDEF_2X and CHAR_REDEF_2Y.

The starting position and the redefined field level number are the key factors to be assessed to help you decide what action you should perform. All of the fields in Figure 31 are part of the 8 bytes of the VSAM record starting at position 63. You must decide which column or columns will contain the data for these 8 bytes, and use the delete column option to remove the remaining fields.

CICS VT supports a maximum of five levels of redefined fields within a group item.





Last updated: November 9, 2012 20:42:48