Controlling the Translation of a COBOL File Description

In this section:

 

You can take advantage of a variety of options to control the translation of a COBOL File Description to a Master File. These options are available from the Create Synonym panes in the adapters that use COBOL FDs. If customization options are not selected. default translation setting are applied.

This topic provides supplementary information for several customization options.


Top of page

x
Customization Options for COBOL File Descriptions

You can customize how a COBOL FD is translated by selecting Customize options in the Synonym creation pane. The following options are added to the right pane:

Parameter

Definition

xOn Error

Choose:

  • Continue to continue generating the Master File when an error occurs. Continue is the default value.
  • Abort to stop generating the Master File when an error occurs.
  • Comment to produce a commented Master File when an error occurs.

xHyphens as

Choose:

  • No to remove all hyphens in the COBOL name from the Master File field names.
  • Yes to replace all hyphens in the COBOL name with the underscore character. Yes is the default value.

xRedefines

You may treat COBOL REDEFINE fields in one of three ways. Choose:

  • Segments to describe REDEFINE fields as segments in the Master File. Segments is the default value.
  • Comments to describe REDEFINE fields as comments in the Master File.
  • None to exclude REDEFINE fields altogether.

xOccurs as

Choose Segments to describe OCCURS structures as segments. Otherwise, choose Field. Segments is the default value.

xAlignment

Choose:

  • Yes to insert slack bytes into a record to ensure alignment of numeric fields.
  • No to generate Master Files without alignment of slack bytes. No is the default value.

xNumber of Hyphens to skip

FD Translator removes characters from the left, up to and including the Nth hyphen (depending on the value of N chosen in the menu).

  • 0 retains the entire COBOL name. 0 is the default value.
  • All removes all prefixes.

xOrder fields

Choose:

  • Yes to generate Order fields in a Master File.
  • No to generate a Master File without Order fields. No is the default value.

xLevel 88 as

Choose:

  • Comment to include COBOL Level 88 fields as comments in the Master Files.
  • Skip to exclude level 88 fields. Skip is the default value.

xZoned Numeric Fields

Sets how zoned numeric values will be stored.

Numeric Field Edit Options

xZeroes

Choose:

  • Suppress to suppress printing of the digit zero for a field whose value is zero.
  • Display to display leading zeroes, for example, 00124.
  • None for no formatting.

xNegative value

Choose:

  • Bracket to bracket negative values, for example, (1234).
  • Credit to credit negative values, for example, 1234 CR.
  • None for no formatting.

xDollar Sign

Choose:

  • Floating to display a floating dollar sign and commas, for example, $1,123.
  • Fixed to display a fixed dollar sign and commas, for example, $ 1,123.
  • None for no formatting.

xSeparate Thousands

Choose:

  • Comma to include commas where appropriate.
  • None for no formatting.


x
REDEFINE Fields

You may treat COBOL REDEFINE fields in one of three ways:

Describing REDEFINEs as segments gives you immediate access to all first-level REDEFINEs but may still require user customization. Note that nested REDEFINEs are described as comments, even with this option. The Segment option is only available in software releases that support it. Including REDEFINEs as comments allows you to customize the Master File output to select the redefinitions of your choice.

Fields are described as comments with a dollar sign ($) in column one. If you wish to use the redefinition of a field instead of the original definition, delete the first definition, or insert dollar signs ($) in column one, and remove the dollar signs ($) from the redefinition.



Example: Generating REDEFINE Fields

Consider the following COBOL input description:

01  CLIENT-REC.
    02  NAME-ADDR-AREA  PIC X(57).
    02  NAME-AND-ADDR
        REDEFINES NAME-ADDR-AREA.
         03  NAME          PIC X(20).
         03  STREET        PIC X(15).
         03  CITY          PIC X(15).
         03  STATE         PIC X(2).
         03  ZIP           PIC X(5).
         03  ZIP_NUMERIC   REDEFINES ZIP PIC 9(5).

The following three Master Files are generated from this input, depending on the value entered for Generate REDEFINE Fields.

For a value of S:

FILE=REDEFS,                       SUFFIX=FIX,                      $
SEGNAME=CLIENSEG,     SEGTYPE=S0,                                   $
   GROUP=CLIENTREC,    ALIAS=E01,   USAGE=A57,      ACTUAL=A57,     $
   FIELD=NAMEADDRAREA, ALIAS=E02,   USAGE=A57,      ACTUAL=A57,     $
SEGNAME=NAMEASEG,     SEGTYPE=U,   PARENT=CLIENSEG,
OCCURS=1,             POSITION=NAMEADDRAREA,                        $
   GROUP=NAMEANDADDR,  ALIAS=E03,   USAGE=A57,      ACTUAL=A57,     $
   FIELD=NAME,         ALIAS=E04,   USAGE=A20,      ACTUAL=A20,     $
   FIELD=STREET,       ALIAS=E05,   USAGE=A15,      ACTUAL=A15,     $
   FIELD=CITY,         ALIAS=E06,   USAGE=A15,      ACTUAL=A15,     $
   FIELD=STATE,        ALIAS=E07,   USAGE=A2,       ACTUAL=A2,      $
   FIELD=ZIP,          ALIAS=E08,   USAGE=A5,       ACTUAL=A5,      $
$  FIELD=ZIP_NUMERIC,  ALIAS=E09,   USAGE=P5,       ACTUAL=Z5,      $

For a value of C:

FILE=REDEFC,                       SUFFIX=FIX,                      $
SEGNAME=CLIENSEG,     SEGTYPE=S0,                                   $
   GROUP=CLIENTREC,    ALIAS=E01,   USAGE=A57,      ACTUAL=A57,     $
   FIELD=NAMEADDRAREA, ALIAS=E02,   USAGE=A57,      ACTUAL=A57,     $
$ GROUP=NAMEANDADDR,   ALIAS=E03,   USAGE=A57,      ACTUAL=A57,     $
$   FIELD=NAME,        ALIAS=E04,   USAGE=A20,      ACTUAL=A20,     $
$   FIELD=STREET,      ALIAS=E05,   USAGE=A15,      ACTUAL=A15,     $
$   FIELD=CITY,        ALIAS=E06,   USAGE=A15,      ACTUAL=A15,     $
$   FIELD=STATE,       ALIAS=E07,   USAGE=A2,       ACTUAL=A2,      $
$   FIELD=ZIP,         ALIAS=E08,   USAGE=A5,       ACTUAL=A5,      $
$   FIELD=ZIP_NUMERIC, ALIAS=E09,   USAGE=P5,       ACTUAL=Z5,      $

For a value of N:

FILE=REDEFN,                       SUFFIX=FIX,                      $
SEGNAME=CLIENSEG,     SEGTYPE=S0,                                   $
   GROUP=CLIENTREC,    ALIAS=E01,   USAGE=A57,      ACTUAL=A57,     $
   FIELD=NAMEADDRAREA, ALIAS=E02,   USAGE=A57,      ACTUAL=A57,     $

Top of page

x
LEVEL 88 as Comments

Level 88 fields in the COBOL FD associate particular values with a field name. Level 88 fields and values are not required in the Master File. However, you can include them as comments. Enter Y (for yes) to include them or N (for no) to exclude them. Including Level 88 fields lets you easily identify values for RECTYPEs for those files that require Level 88 fields. (You must manually add the RECTYPE and value. Because many Level 88 fields may occur in a COBOL FD, it is impossible to successfully determine the appropriate RECTYPE fields and values.) Since Level 88 field names typically describe the values they represent, including them as comments is also a way to document the Master File.



Example: Generating LEVEL 88 as Comments

Consider the following COBOL input description:

01  EMPL-REC.
    02  EMPL-SOC-SEC-NUM          PIC S9(8) COMP-3.
    02  EMPL-STATUS               PIC X(1).
        88  EMPL-ACTIVE                     VALUE 'A'.
        88  EMPL-INACTIVE                   VALUE 'I'.
        88  EMPL-RETIRED                    VALUE 'R'.

The following two Master Files are generated from this input, depending on the value entered for Generate LEVEL 88 as Comments.

For a value of Y:

FILE=LEV88Y,                       SUFFIX=FIX,                      $
SEGNAME=RECSEG,       SEGTYPE=S0,                                   $
   FIELD=SOCSECNUM,    ALIAS=E01,   USAGE=P9,       ACTUAL=P5,      $
   FIELD=STATUS,       ALIAS=E02,   USAGE=A1,       ACTUAL=A1,      $
$       ACTIVE, VALUE 'A'.                                          $
$       INACTIVE, VALUE 'I'.                                        $
$       RETIRED, VALUE 'R'.                                         $

The Level 88 fields are indented under the field they describe (STATUS). The values are left-justified to include the maximum information in the Master File, when many values are in the COBOL record. If the COBOL Level 88 values exceed one line in the FD, only the first line will be included in the Master File.

For a value of N:

FILE=LEV88N,                       SUFFIX=FIX,                      $
SEGNAME=RECSEG,       SEGTYPE=S0,                                   $
   FIELD=SOCSECNUM,    ALIAS=E01,   USAGE=P9,       ACTUAL=P5,      $
   FIELD=STATUS,       ALIAS=E02,   USAGE=A1,       ACTUAL=A1,      $

Top of page

x
OCCURS as Segments

COBOL FD translation supports all forms of COBOL OCCURS structures: fixed, variable, and nested. You may describe OCCURS structures as segments in the Master File or as individual, numbered fields. Enter Y (for yes) to describe OCCURS structures as segments or N (for no) otherwise.

Fixed and nested repeating groups described as segments use the OCCURS clause to describe the number of occurrences of the group. For fixed repeating groups, the OCCURS value is the number of occurrences. For variable OCCURS, the value is the name of the COBOL DEPENDING ON field. The POSITION attribute is used to describe their location in the record, which is reserved in the Master File with an internally generated POSITION field. All internal POSITION fields generated by the translation end with POSN.

Fixed repeating groups described as numbered fields have a unique number appended to the COBOL field name, once for each occurrence. Because the number of occurrences of a variably occurring group is unknown, they cannot be described individually. In fact, if any one of the repeating groups is variable, they are all described as segments, including fixed occurs, regardless of your menu selection.



Example: Simple Fixed OCCURS

Consider the following COBOL input description:

01  TBL-REC.
    02  TBL-ENTRY OCCURS 2 TIMES.
        03  TBL-AMT-A                   PIC S9(5).
        03  TBL-AMT-B                   PIC S9(5).

The translation can generate the following two Master Files from this input, depending on the value entered for Describe OCCURS as Segments.

For a value of Y:

FILE=OCCURSFY,                     SUFFIX=FIX,                      $
SEGNAME=TBLRESEG,     SEGTYPE=S0,                                   $
   GROUP=TBLREC,       ALIAS=E01,   USAGE=A20,      ACTUAL=A20,     $
   FIELD=TBLENSEGPOSN, ALIAS=E02,   USAGE=A20,      ACTUAL=A20,     $
SEGNAME=TBLENSEG,     SEGTYPE=S0,  PARENT=TBLRESEG,
OCCURS=2,             POSITION=TBLENSEGPOSN,                        $
   GROUP=TBLENTRY,     ALIAS=E03,   USAGE=A16,      ACTUAL=A10,     $
   FIELD=TBLAMTA,      ALIAS=E04,   USAGE=P6,       ACTUAL=Z5,      $
   FIELD=TBLAMTB,      ALIAS=E05,   USAGE=P6,       ACTUAL=Z5,      $

For a value of N:

FILE=OCCURSFN,                     SUFFIX=FIX,                      $
SEGNAME=TBLRESEG,     SEGTYPE=S0,                                   $
   GROUP=TBLREC,       ALIAS=E01,   USAGE=A32,      ACTUAL=A20,     $
   GROUP=TBLENTRY1,    ALIAS=E02,   USAGE=A16,      ACTUAL=A10,     $
   FIELD=TBLAMTA1,     ALIAS=E03,   USAGE=P6,       ACTUAL=Z5,      $
   FIELD=TBLAMTB1,     ALIAS=E04,   USAGE=P6,       ACTUAL=Z5,      $
   GROUP=TBLENTRY2,    ALIAS=E05,   USAGE=A16,      ACTUAL=A10,     $
   FIELD=TBLAMTA2,     ALIAS=E06,   USAGE=P6,       ACTUAL=Z5,      $
   FIELD=TBLAMTB2,     ALIAS=E07,   USAGE=P6,       ACTUAL=Z5,      $


Example: Variable OCCURS

Consider the following COBOL input description:

01  TABLE-REC.
    02  TABLE-COUNT            PIC S9(2) COMP.
    02  TABLE-ENTRY
        OCCURS 1 TO 10 TIMES
        DEPENDING ON TABLE-COUNT.
        03  TABLE-AMT-A        PIC S9(5).
        03  TABLE-AMT-B        PIC S9(5).

The translation generates the following Master Files from this input when either Y or N is entered for Describe OCCURS as Segments:

FILE=OCCURSVY,                     SUFFIX=FIX,                      $
SEGNAME=TABLESEG,     SEGTYPE=S0,                                   $
   FIELD=TABLECOUNT,   ALIAS=E01,   USAGE=I3,       ACTUAL=I2,      $
SEGNAME=TABLESE2,     SEGTYPE=S0,  PARENT=TABLESEG,
OCCURS=TABLECOUNT,                                                  $
   GROUP=TABLEENTRY,   ALIAS=E02,   USAGE=A16,      ACTUAL=A10,     $
   FIELD=TABLEAMTA,    ALIAS=E03,   USAGE=P6,       ACTUAL=Z5,      $
   FIELD=TABLEAMTB,    ALIAS=E04,   USAGE=P6,       ACTUAL=Z5,      $

The fields to be reported from (TABLEAMTA and TABLEAMTB) are within the OCCURS segment. The number of table occurrences is determined automatically by the TABLECOUNT field.



Example: Nested OCCURS

Consider the following COBOL input description:

01  TABLE-REC.
    02  TABLE-LEVEL-A OCCURS 2.
        03  TABLE-LEVEL-B OCCURS 3.
            04  TABLE-AMT               PIC S9(5) COMP-3.

The translation can generate the following two Master Files from this input, depending on the value entered for Describe OCCURS as Segments:

For a value of Y:

FILE=OCCURSNY,                     SUFFIX=FIX,                      $
SEGNAME=TABLESEG,     SEGTYPE=S0,                                   $
   GROUP=TABLEREC,     ALIAS=E01,   USAGE=A18,      ACTUAL=A18,     $
   FIELD=TABLESE2POSN, ALIAS=E02,   USAGE=A18,      ACTUAL=A18,     $
SEGNAME=TABLESE2,     SEGTYPE=S0,  PARENT=TABLESEG,
OCCURS=2,             POSITION=TABLESE2POSN,                        $
   GROUP=TABLELEVELA,  ALIAS=E03,   USAGE=A9,       ACTUAL=A9,      $
   FIELD=TABLESE3POSN, ALIAS=E04,   USAGE=A9,       ACTUAL=A9,      $
SEGNAME=TABLESE3,     SEGTYPE=S0,  PARENT=TABLESE2,
OCCURS=3,             POSITION=TABLESE3POSN,                        $
   GROUP=TABLELEVELB,  ALIAS=E05,   USAGE=A8,       ACTUAL=A3,      $
   FIELD=TABLEAMT,     ALIAS=E06,   USAGE=P6,       ACTUAL=P3,      $

The translation defines the nested table structure with nested segments. You need only refer to the final reporting field, TABLEAMT.

For a value of N:

FILE=OCCURSNN,                     SUFFIX=FIX,                      $
SEGNAME=TABLESEG,     SEGTYPE=S0,                                   $
   GROUP=TABLEREC,     ALIAS=E01,   USAGE=A48,      ACTUAL=A18,     $
   GROUP=TABLELEVELA1, ALIAS=E02,   USAGE=A24,      ACTUAL=A9,      $
   GROUP=TABLELEVELB1, ALIAS=E03,   USAGE=A8,       ACTUAL=A3,      $
   FIELD=TABLEAMT11,   ALIAS=E04,   USAGE=P6,       ACTUAL=P3,      $
   GROUP=TABLELEVELB2, ALIAS=E05,   USAGE=A8,       ACTUAL=A3,      $
   FIELD=TABLEAMT12,   ALIAS=E06,   USAGE=P6,       ACTUAL=P3,      $
   GROUP=TABLELEVELB3, ALIAS=E07,   USAGE=A8,       ACTUAL=A3,      $
   FIELD=TABLEAMT13,   ALIAS=E08,   USAGE=P6,       ACTUAL=P3,      $
   GROUP=TABLELEVELA2, ALIAS=E09,   USAGE=A24,      ACTUAL=A9,      $
   GROUP=TABLELEVELB4, ALIAS=E10,   USAGE=A8,       ACTUAL=A3,      $
   FIELD=TABLEAMT21,   ALIAS=E11,   USAGE=P6,       ACTUAL=P3,      $
   GROUP=TABLELEVELB5, ALIAS=E12,   USAGE=A8,       ACTUAL=A3,      $
   FIELD=TABLEAMT22,   ALIAS=E13,   USAGE=P6,       ACTUAL=P3,      $
   GROUP=TABLELEVELB6, ALIAS=E14,   USAGE=A8,       ACTUAL=A3,      $
   FIELD=TABLEAMT23,   ALIAS=E15,   USAGE=P6,       ACTUAL=P3,      $

Top of page

x
ORDER Field

If you wish to select specific occurrences for reporting, add an ORDER field to the Master File as the last entry of the OCCURS segment:

FIELD=fieldname,    ALIAS=ORDER, USAGE=I4,       ACTUAL=I4, $

The value for ALIAS must be ORDER, the value for ACTUAL must be I4, the field name is arbitrary, and the value for USAGE must be an integer (I) but can be of any length from 1 to 9. The ORDER field is automatically populated.



Example: ORDER Field Sequence With Nested OCCURS

The following example adds the ORDER field SEQUENCE to the nested fixed OCCURS segments 2 and 3:

FILE=OCCURSNY,                     SUFFIX=FIX,                      $
SEGNAME=TABLESEG,     SEGTYPE=S0,                                   $
   GROUP=TABLEREC,     ALIAS=E01,   USAGE=A18,      ACTUAL=A18,     $
   FIELD=TABLESE2POSN, ALIAS=E02,   USAGE=A18,      ACTUAL=A18,     $
SEGNAME=TABLESE2,     SEGTYPE=S0,  PARENT=TABLESEG,
OCCURS=2,             POSITION=TABLESE2POSN,                        $
   GROUP=TABLELEVELA,  ALIAS=E03,   USAGE=A9,       ACTUAL=A9,      $
   FIELD=TABLESE3POSN, ALIAS=E04,   USAGE=A9,       ACTUAL=A9,      $
   FIELD=SEQUENCEA,    ALIAS=ORDER, USAGE=I4,       ACTUAL=I4,      $
SEGNAME=TABLESE3,     SEGTYPE=S0,  PARENT=TABLESE2,
OCCURS=3,             POSITION=TABLESE3POSN,                        $
   GROUP=TABLELEVELB,  ALIAS=E05,   USAGE=A8,       ACTUAL=A3,      $
   FIELD=TABLEAMT,     ALIAS=E06,   USAGE=P6,       ACTUAL=P3,      $
   FIELD=SEQUENCEB,    ALIAS=ORDER, USAGE=I4,       ACTUAL=I4,      $

Top of page

x
Zoned Numeric Field Usage

A COBOL FD may describe alphanumeric characters as zoned decimal numeric data using the PICTURE 9(n) clause. This clause is commonly used for numeric string data on which no arithmetic operations is performed, such as phone numbers, identification numbers, and dates. You can describe these fields in packed numeric or alphanumeric USAGE format (enter the values P or A, respectively). The ACTUAL format is described as zoned (Z).

If you intend to use COBOL numeric display fields for summing or in mathematical operations, use the packed option. If you intend to use these elements for display only, use the alphanumeric option. Only simple numeric display elements of the format PICTURE 9(n) are subject to this feature. Signed elements (PICTURE S9(n)) and elements with decimal positions (PICTURE 9(n)V(m)) are always described as packed.



Example: Zoned Numeric Field Usage

Consider the following COBOL input description:

01 EMPL-REC.
      02 EMPL-SOC-SEC-NUM         PIC 9(8).
      02 EMPL-HIRE-DATE.
         03 EMPL-HIRE-YEAR        PIC 9(2).
         03 EMPL-HIRE-MONTH       PIC 9(2).
         03 EMPL-HIRE-DAY         PIC 9(2).
      02 EMPL-SICK-DAYS-ALLOWED   PIC S9(2).
      02 EMPL-SICK-DAYS-TAKEN     PIC 9(2).
      02 EMPL-YTD-HOURS-WORKED    PIC 9(4)V9(2).

The translation can generate the following two Master Files from this input, depending on the value entered for Zoned Numeric Field Usage.

For a value of P:

FILE=ZONEDP,                       SUFFIX=FIX,                      $
SEGNAME=RECSEG,       SEGTYPE=S0,                                   $
   GROUP=REC,          ALIAS=E01,   USAGE=A56,      ACTUAL=A24,     $
   FIELD=SOCSECNUM,    ALIAS=E02,   USAGE=P8,       ACTUAL=Z8,      $
   GROUP=HIREDATE,     ALIAS=E03,   USAGE=A24,      ACTUAL=A6,      $
   FIELD=HIREYEAR,     ALIAS=E04,   USAGE=P2,       ACTUAL=Z2,      $
   FIELD=HIREMONTH,    ALIAS=E05,   USAGE=P2,       ACTUAL=Z2,      $
   FIELD=HIREDAY,      ALIAS=E06,   USAGE=P2,       ACTUAL=Z2,      $
   FIELD=SICKDAYSALLO, ALIAS=E07,   USAGE=P3,       ACTUAL=Z2,      $
   FIELD=SICKDAYSTAKE, ALIAS=E08,   USAGE=P2,       ACTUAL=Z2,      $
   FIELD=YTDHOURSWORK, ALIAS=E09,   USAGE=P7.2,     ACTUAL=Z6,      $

For a value of A:

FILE=ZONEDA,                       SUFFIX=FIX,                      $
SEGNAME=RECSEG,       SEGTYPE=S0,                                   $
   GROUP=REC,          ALIAS=E01,   USAGE=A32,      ACTUAL=A24,     $
   FIELD=SOCSECNUM,    ALIAS=E02,   USAGE=A8,       ACTUAL=Z8,      $
   GROUP=HIREDATE,     ALIAS=E03,   USAGE=A6,       ACTUAL=A6,      $
   FIELD=HIREYEAR,     ALIAS=E04,   USAGE=A2,       ACTUAL=Z2,      $
   FIELD=HIREMONTH,    ALIAS=E05,   USAGE=A2,       ACTUAL=Z2,      $
   FIELD=HIREDAY,      ALIAS=E06,   USAGE=A2,       ACTUAL=Z2,      $
   FIELD=SICKDAYSALLO, ALIAS=E07,   USAGE=P3,       ACTUAL=Z2,      $
   FIELD=SICKDAYSTAKE, ALIAS=E08,   USAGE=A2,       ACTUAL=Z2,      $
   FIELD=YTDHOURSWORK, ALIAS=E09,   USAGE=P7.2,     ACTUAL=Z6,      $

The two generated Master Files contains zoned decimal fields that are truly used in numeric and alphanumeric formats, but the translation cannot distinguish between the two cases. You must select the option most appropriate to your situation. You may edit the resulting Master File to change the formats to packed or alphanumeric as necessary. The USAGE length of any GROUP fields that contain these zoned fields must also be changed, according to the format conversion rules in General Format Conversion Notes.


Top of page

x
Numeric Field Edit Options

The COBOL FD translation automatically adds any edit options that you supply to all numeric fields in the generated Master File. Edit options affect how the numeric data is displayed. The options are as follows:

S - Suppresses printing of the digit zero for a field whose value is zero.

C - Includes commas where appropriate, for example, 1,234.

B - Brackets negative values, for example, (1234).

R - Credits negative values, for example, 1234 CR.

M - Displays a floating dollar sign with commas, for example, $1,234.

N - Displays a fixed dollar sign with commas, for example, $ 1,234.

L - Displays leading zeroes, for example, 001234.

You may enter up to five edit options. You may leave this option blank if you do not wish to edit numeric fields. Edit options may be entered in any order and combination except for the pairs SL, MN, and BR, which are mutually exclusive.



Example: Numeric Field Edit Options

Consider the following COBOL input description:

01  PAYROLL-REC.
      05  PAYROLL-NAME.
          10  PAYROLL-LAST-NAME   PIC X(20).
          10  PAYROLL-FIRST-NAME  PIC X(10).
      05  PAYROLL-AMT-FIELDS.
          10 PAYROLL-AMT-CURR-YR  PIC S9(7)V99 COMP-3.
          10 PAYROLL-AMT-PREV-YR  PIC S9(7)V99 COMP-3.

The translation generates the following Master Files from this input when MB is entered for Numeric Field Edit Options:

FILE=EDITOPT,                      SUFFIX=FIX,                      $
SEGNAME=RECSEG,       SEGTYPE=S0,                                   $
   GROUP=REC,          ALIAS=E01,   USAGE=A46,      ACTUAL=A40,     $
   GROUP=NAME,         ALIAS=E02,   USAGE=A30,      ACTUAL=A30,     $
   FIELD=LASTNAME,     ALIAS=E03,   USAGE=A20,      ACTUAL=A20,     $
   FIELD=FIRSTNAME,    ALIAS=E04,   USAGE=A10,      ACTUAL=A10,     $
   GROUP=AMTFIELDS,    ALIAS=E05,   USAGE=A16,      ACTUAL=A10,     $
   FIELD=AMTCURRYR,    ALIAS=E06,   USAGE=P11.2MB,  ACTUAL=P5,      $
   FIELD=AMTPREVYR,    ALIAS=E07,   USAGE=P11.2MB,  ACTUAL=P5,      $

Top of page

x
Field Name Information

The translation generates field names in the Master File from COBOL field names using the following:

  1. The Skip 'n' Hyphens option removes characters from the left, up to and including the nth hyphen (depending on the value of n you entered on the menu). It then either removes all remaining hyphens or replaces them with underscores, depending on the setting of the menu option Remove Hyphens or Use Underbars. Finally, if the Field Name Length option has been set to 12, only the 12 leftmost characters are used.
  2. If the name duplicates a previously-generated field name, a qualifier is added to make it unique. For example, given the following COBOL structure
    02  EMPL-PORTION.
        03  SOC-SEC-NUM  PIC 9(9).
    02  MGR-PORTION.
        03  SOC-SEC-NUM  PIC 9(9).

    SOCSECNUM is generated from the first elementary field name and SOCSECNUM2 from the second elementary field name.

The following table illustrates the results of the possible combinations of menu options that control field name generation.

COBOL Field Name: PAYROLL-REC-IN-FICA

Field Name Length

Remove Hyphens or Use Underbars

Skip 'n' Hyphens

Generated Field Name

12
Remove Hyphens
0
1
2
3
PAYROLLRECIN
RECINFICA
INFICA
FICA
 
Use Underbars
0
1
2
3
PAYROLL_REC
REC_IN_FICA
IN_FICA
FICA
30
Remove Hyphens
0
1
2
3
PAYROLLRECINFICA
RECINFICA
INFICA
FICA
 
Use Underbars
0
1
2
3
PAYROLL_REC_IN_FICA
REC_IN_FICA
IN_FICA
FICA


x
General Format Conversion Notes

Format conversion is the process of defining the ACTUAL and USAGE formats based on the COBOL format. The translation performs the conversion as described in the following table:

COBOL Format

ACTUAL

USAGE

PICTURE  X(n)
An
An
PICTURE  9(n)
Zn (packed option)
Pn (packed option)
PICTURE  9(n)
An (alpha option)
An (alpha option)
PICTURE S9(n)
Zn
Pn+1
PICTURE  9(n)V9(m)
Zn+m
Pn+m+1.m
PICTURE S9(n)V9(m)
Zn+m
Pn+m+2.m
PICTURE  9(n) COMP (1 # n # 4)
I2
I9
PICTURE  9(n) COMP (5 # n # 9)
I4
I9
PICTURE  9(n) COMP (n > 9)
A8
A8
COMP-1
F4
F8
COMP-2
D8
D15
PICTURE  9(n)      COMP-3
P(n+2/2)
Pn
PICTURE S9(n)      COMP-3
P(n+2/2)
Pn+1
PICTURE  9(n)V9(m) COMP-3
P(n+m+2/2)
Pn+m+1.m
PICTURE S9(n)V9(m) COMP-3
P(n+m+2/2)
Pn+m+2.m

The format conversions are subject to the following limitations:



x
Multiple Records as Input

The translation generates a new segment for each COBOL record description (01-level field) it receives as input. When multiple records are present, an additional DUMMY segment is created that is used as the common parent for the record descriptions. Whenever you submit more than one 01-level record as input, you must manually add RECTYPE fields to identify the different record types.



Example: Multiple Records as Input

Consider the following COBOL input description:

01  HDR-REC.
       02  HDR-KEY            PIC X(1).
           88 HDR-VALUE       VALUE 'H'.
       02  HDR-DATA           PIC X(10).
01  DET-REC.
       02  DET-KEY            PIC X(1).
           88 DTL-VALUE       VALUE 'D'.
       02  DTL-DATA           PIC X(10).

From this input, the following Master File with multiple segments is created:

FILE=MULT01,                       SUFFIX=FIX,                      $
SEGNAME=DUMMY,        SEGTYPE=S0,                                   $
   FIELD=,             ALIAS=,      USAGE=A1,       ACTUAL=A1,      $
SEGNAME=HDRRESEG,     SEGTYPE=S0,  PARENT=DUMMY,                    $
   GROUP=HDRREC,       ALIAS=E01,   USAGE=A11,      ACTUAL=A11,     $
   FIELD=HDRKEY,       ALIAS=E02,   USAGE=A1,       ACTUAL=A1,      $
   $     HDRVALUE, VALUE 'H'.                                       $
   FIELD=HDRDATA,      ALIAS=E03,   USAGE=A10,      ACTUAL=A10,     $
SEGNAME=DETRESEG,     SEGTYPE=S0,  PARENT=DUMMY,                    $
   GROUP=DETREC,       ALIAS=E04,   USAGE=A11,      ACTUAL=A11,     $
   FIELD=DETKEY,       ALIAS=E05,   USAGE=A1,       ACTUAL=A1,      $
   $     DTLVALUE, VALUE 'D'.                                       $
   FIELD=DTLDATA,      ALIAS=E06,   USAGE=A10,      ACTUAL=A10,     $

After editing to add the RECTYPE information, the completed Master File is:

FILE=MULT01,                       SUFFIX=FIX,                      $
SEGNAME=DUMMY,        SEGTYPE=S0,                                   $
   FIELD=,             ALIAS=,      USAGE=A1,       ACTUAL=A1,      $
SEGNAME=HDRRESEG,     SEGTYPE=S0,  PARENT=DUMMY,                    $
   GROUP=HDRREC,       ALIAS=E01,   USAGE=A11,      ACTUAL=A11,     $
   FIELD=RECTYPE,      ALIAS=H,     USAGE=A1,       ACTUAL=A1,      $
   $     HDRVALUE, VALUE 'H'.                                       $
   FIELD=HDRDATA,      ALIAS=E03,   USAGE=A10,      ACTUAL=A10,     $
SEGNAME=DETRESEG,     SEGTYPE=S0,  PARENT=DUMMY,                    $
   GROUP=DETREC,       ALIAS=E04,   USAGE=A11,      ACTUAL=A11,     $
   FIELD=RECTYPE,      ALIAS=D,     USAGE=A1,       ACTUAL=A1,      $
   $     DTLVALUE, VALUE 'D'.                                       $
   FIELD=DTLDATA,      ALIAS=E06,   USAGE=A10,      ACTUAL=A10,     $

Top of page

x
Maximum Number of Fields

Each 01-level record input can contain up to 4,000 fields. Any number of 01-level entries can be used as input to the translation, as long as no individual record exceeds this limit. Each occurrence of an OCCURS structure counts in this limit. If the limit is exceeded, an error message is printed and program execution stops. Note that this limitation applies to the translation and not the Master File generated.



Example: Maximum Number of Fields

Consider the following COBOL input description:

01  REC1.
    02  FLD1  OCCURS  5000  TIMES  PIC  X(1).

This input generates the following message:

FR011E - INTERNAL TABLE OVERFLOW

To bypass this limitation, edit the COBOL FD and temporarily reduce the total number of OCCURS. After execution, edit the Master File and restore the original number of occurrences.

Consider the following COBOL input description:

01  REC1.
    02  FLD1  OCCURS  2000  TIMES  PIC  X(1).
01  REC2.
    02  FLD2  OCCURS  2000  TIMES  PIC  X(1).

The following Master File, with multiple segments, is created from this input:

FILE=MAXRECS,                      SUFFIX=FIX,                      $
SEGNAME=DUMMY,        SEGTYPE=S0,                                   $
   FIELD=,             ALIAS=,      USAGE=A1,       ACTUAL=A1,      $
SEGNAME=REC1SEG,      SEGTYPE=S0,  PARENT=DUMMY,                    $
$  GROUP=REC1,         ALIAS=E01,   USAGE=A2000,    ACTUAL=A2000,   $
   FIELD=FLD1SEGPOSN,  ALIAS=E02,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E03,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E04,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E05,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E06,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E07,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E08,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E09,   USAGE=A208,     ACTUAL=A208,    $
SEGNAME=FLD1SEG,      SEGTYPE=S0,  PARENT=REC1SEG,
OCCURS=2000,          POSITION=FLD1SEGPOSN,                         $
   FIELD=FLD1,         ALIAS=E10,   USAGE=A1,       ACTUAL=A1,      $
SEGNAME=REC2SEG,      SEGTYPE=S0,  PARENT=DUMMY,                    $
$  GROUP=REC2,         ALIAS=E11,   USAGE=A2000,    ACTUAL=A2000,   $
   FIELD=FLD2SEGPOSN,  ALIAS=E12,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E13,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E14,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E15,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E16,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E17,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E18,   USAGE=A256,     ACTUAL=A256,    $
   FIELD=FILLER,       ALIAS=E19,   USAGE=A208,     ACTUAL=A208,    $
SEGNAME=FLD2SEG,      SEGTYPE=S0,  PARENT=REC2SEG,
OCCURS=2000,          POSITION=FLD2SEGPOSN,                         $
   FIELD=FLD2,         ALIAS=E20,   USAGE=A1,       ACTUAL=A1,      $

This description does not exceed the 4,000 field limit because each 01-level has fewer than 4,000 fields.


Top of page

x
Year 2000

Because a COBOL FD cannot describe fields as dates, the translation cannot reliably determine which fields are dates and apply date formats to them. However, you can edit Master Files generated during synonym creation to add date formats and date defaults. These are respected in Information Builders software designed to take advantage of them.


Top of page

x
COBOL FD Syntax Requirements

Reference:

The COBOL FD translation requires a syntactically correct COBOL file description as input. While scanning the COBOL file description during synonym creation, a number of syntax checks are performed. If any of the COBOL statements are invalid, debugging messages are displayed, the program stops executing, and a Master File is not generated. Although the syntax check can identify a variety of errors, you should specify only valid COBOL file descriptions that compile successfully.



x
Reference: COBOL FD Syntax Guidelines

At a minimum, a valid COBOL file description must follow these guidelines:


iWay Software