Special Options Input and Output

From the Translator menu, you can also generate GROUP fields, REDEFINE fields, Level 88 comments, and describe COBOL OCCURS as segments. The following topics give examples of input and output for the different values for these options.

In this section:

Generate GROUP Fields

Generate REDEFINE Fields

Generate LEVEL 88 as Comments

Describe OCCURS as Segments

ORDER Field

Example:

Generate GROUP Fields

Generate REDEFINE Fields

Generate LEVEL 88 as Comments

Simple Fixed OCCURS

Variable OCCURS

Nested OCCURS

Generate GROUP Fields

You have three options for how GROUP fields are included in the Master File generated by the Translator:

A printable group is one that is composed only of alphanumeric elements. A non-printable group is composed of one or more numeric elements, which are not readable when printed as part of the group. Note that any GROUP field that exceeds 256 characters will always be included in the Master File as a comment.


Top of page

Example: Generate GROUP Fields

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 Translator can generate the following three Master Files from this input, depending on the value entered for Generate GROUP Fields.

For a value of A:

FILE=GROUPA,                       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.2, ACTUAL=P5, $
FIELD=AMTPREVYR, ALIAS=E07, USAGE=P11.2, ACTUAL=P5, $

For a value of N:

FILE=GROUPN,                       SUFFIX=FIX,                     $
SEGNAME=RECSEG, SEGTYPE=S0, $
FIELD=LASTNAME, ALIAS=E01, USAGE=A20, ACTUAL=A20, $
FIELD=FIRSTNAME, ALIAS=E02, USAGE=A10, ACTUAL=A10, $
FIELD=AMTCURRYR, ALIAS=E03, USAGE=P11.2, ACTUAL=P5, $
FIELD=AMTPREVYR, ALIAS=E04, USAGE=P11.2, ACTUAL=P5, $

For a value of P:

FILE=GROUPP,                       SUFFIX=FIX,                     $
SEGNAME=RECSEG, SEGTYPE=S0, $
GROUP=NAME, ALIAS=E01, USAGE=A30, ACTUAL=A30, $
FIELD=LASTNAME, ALIAS=E02, USAGE=A20, ACTUAL=A20, $
FIELD=FIRSTNAME, ALIAS=E03, USAGE=A10, ACTUAL=A10, $
FIELD=AMTCURRYR, ALIAS=E04, USAGE=P11.2, ACTUAL=P5, $
FIELD=AMTPREVYR, ALIAS=E05, USAGE=P11.2, ACTUAL=P5, $

For the P value output, the group field REC contains two numeric fields, AMTCURRYR and AMTPREVYR, and is therefore not included in the Master File. You should include all groups when describing VSAM files whose primary keys contain numeric fields.


Top of page

Generate 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.


Top of page

Example: Generate 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 Translator can generate the following three Master Files 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

Generate LEVEL 88 as Comments

Level 88 fields in the COBOL FD associate particular values with a fieldname. Level 88 fields and values are not required in the Master File; however, the Translator allows you to 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 for the Translator to successfully determine the appropriate RECTYPE fields and values.) Since Level 88 fieldnames typically describe the values they represent, including them as comments is also a way to document the Master File.


Top of page

Example: Generate 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 Translator can generate the following two Master Files 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

Describe OCCURS as Segments

The Translator 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 Translator end with POSN.

Fixed repeating groups described as numbered fields have a unique number appended to the COBOL fieldname, 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.


Top of page

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 Translator 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, $

Top of page

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 Translator 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.


Top of page

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 Translator 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 Translator 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

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 fieldname 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.

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, $

Information Builders