Skip to main content

Data element mapping report

  • April 5, 2018
  • 2 replies
  • 0 views

One of our customers has asked if there is a way to produce a report that contains position and displacement of each field as in the below example. 

 

  LEVEL AND DATA NAME                               START   END  BYTES   DESC

  01  PRIMARY-REC                                         1         4000   4000

    05  P-CLIENT-NUMBER                                1          4           4    X(4)

    05  P-LOAN-NUM                                         5         11          7    X(7)

    05  P-LOAN-NUM-RED REDEFINES                5         11          7    9(13) COMP-3

    05  P-REC-TYPE                                          12        15         4

      10  P-REC-TYPE1                                      12        12         1     X

      10  P-REC-NUM2                                       13        15         3    999

    05  P-NAME-ADDRESS                                 16        281       266

      10  P-NAME                                              16        45         30    X(30)

      10  P-ADR1                                              46        75         30    X(30)

      10  P-ADR2                                              76        105        30    X(30)

      10  P-ADR3                                              106      135        30    X(30)

      10  P-ADR4                                              136      165        30    X(30)

      10  P-ADR5                                              166      198        33

        15  P-CITY                                             166      186        21    X(21)

        15  P-STATE                                          187       188        2    XX

        15  P-ZIP                                              189       198        10

          20  P-ZIP5                                          189       193         5    X(5)

          20  P-ZIP-DASH                                  194       194         1    X

          20  P-ZIP4                                          195       198         4    X(4)


#COBOL
#EnterpriseDeveloper

2 replies

  • Author
  • Rocketeer
  • 19312 replies
  • April 5, 2018

One of our customers has asked if there is a way to produce a report that contains position and displacement of each field as in the below example. 

 

  LEVEL AND DATA NAME                               START   END  BYTES   DESC

  01  PRIMARY-REC                                         1         4000   4000

    05  P-CLIENT-NUMBER                                1          4           4    X(4)

    05  P-LOAN-NUM                                         5         11          7    X(7)

    05  P-LOAN-NUM-RED REDEFINES                5         11          7    9(13) COMP-3

    05  P-REC-TYPE                                          12        15         4

      10  P-REC-TYPE1                                      12        12         1     X

      10  P-REC-NUM2                                       13        15         3    999

    05  P-NAME-ADDRESS                                 16        281       266

      10  P-NAME                                              16        45         30    X(30)

      10  P-ADR1                                              46        75         30    X(30)

      10  P-ADR2                                              76        105        30    X(30)

      10  P-ADR3                                              106      135        30    X(30)

      10  P-ADR4                                              136      165        30    X(30)

      10  P-ADR5                                              166      198        33

        15  P-CITY                                             166      186        21    X(21)

        15  P-STATE                                          187       188        2    XX

        15  P-ZIP                                              189       198        10

          20  P-ZIP5                                          189       193         5    X(5)

          20  P-ZIP-DASH                                  194       194         1    X

          20  P-ZIP4                                          195       198         4    X(4)


#COBOL
#EnterpriseDeveloper
Does the DATAMAP directive not give you enough information?

  • 0 replies
  • April 6, 2018

One of our customers has asked if there is a way to produce a report that contains position and displacement of each field as in the below example. 

 

  LEVEL AND DATA NAME                               START   END  BYTES   DESC

  01  PRIMARY-REC                                         1         4000   4000

    05  P-CLIENT-NUMBER                                1          4           4    X(4)

    05  P-LOAN-NUM                                         5         11          7    X(7)

    05  P-LOAN-NUM-RED REDEFINES                5         11          7    9(13) COMP-3

    05  P-REC-TYPE                                          12        15         4

      10  P-REC-TYPE1                                      12        12         1     X

      10  P-REC-NUM2                                       13        15         3    999

    05  P-NAME-ADDRESS                                 16        281       266

      10  P-NAME                                              16        45         30    X(30)

      10  P-ADR1                                              46        75         30    X(30)

      10  P-ADR2                                              76        105        30    X(30)

      10  P-ADR3                                              106      135        30    X(30)

      10  P-ADR4                                              136      165        30    X(30)

      10  P-ADR5                                              166      198        33

        15  P-CITY                                             166      186        21    X(21)

        15  P-STATE                                          187       188        2    XX

        15  P-ZIP                                              189       198        10

          20  P-ZIP5                                          189       193         5    X(5)

          20  P-ZIP-DASH                                  194       194         1    X

          20  P-ZIP4                                          195       198         4    X(4)


#COBOL
#EnterpriseDeveloper

we run ED 2.3 and PL/I, and can use the option -adt to create .adt files when we compile. The .adt file can be used in the "classic data file tools" as an input for record layouts. The result .str file is very similar to what you are asking for above.

For COBOL, the tool requires .idy "COBOL Information File"