Incorporating COBOL Copy Code

#### Search Results

Search

# Incorporating COBOL Copy Code

This function builds a Predict file and linked fields from COBOL copy code (record description or a subordinate section without a level 01 entry). Up to 20 files can be built per session. The copy code may contain only the following:

- File definitions. Each line may contain a maximum of one data definition.

- Blank lines.

- Comment lines. Comments are added to the last valid file or field object that is incorporated.

It is not possible to incorporate information from COBOL programs.

The information incorporated is stored in Predict file objects of type sequential and field objects.

This document covers the following topics:

- Prerequisites for COBOL Copy Code

- Calling the Function

- Incorporating COBOL Copy Code in Batch Mode

- Representation of COBOL Field Definitions in Predict

## Prerequisites for COBOL Copy Code

The following resources are required for this function:

- Natural workfile 1 (record format F or FB with record length 80, V or VB)

- Natural workfile 2 (record format V or VB, record length at least 44).

In batch mode, the following additional resources are also required:

- Natural report 1

- Natural report 2

- Natural report 3.

## Calling the Function

The Incorporate COBOL Copy Code screen is called with function code I and object type code CO in any Predict main menu or with command `INCORPORATE COBOL`.

    09:59:05             *****  P R E D I C T  *****             2007-05-31
    Plan   0               - Incorporate COBOL Copy Code -

    File ID ..........

    Incorporation options
      Prefix .............. A-
      Decimal character ..* P
      Currency sign ......* $
      Literal delimiter ..* '
      List ...............* R
      Store ............... Y  (Y,N)
      Replace ............. N  (Y,N)
      Input type .........* W
      Compiler ...........* 7
      Comment lines to ...* A
      RE-Group as Group ... Y  (Y,N)

Parameters
File ID | If file ID is not specified, level 01 entries on the workfile are interpreted as file IDs. A new file is created for each new level 01 entry. All other entries are interpreted as fields of these files. If file ID is specified, all entries on the workfile are interpreted as fields of this file. Level 01 entries are taken as groups.
Incorporation Options
Prefix | Prefix to be added to any field ID with an invalid initial character for a Predict object ID. See Naming Conventions in the section General Information in the Predefined Object Types in Predict documentation. Field IDs that are too long are truncated from the right.
Decimal character |
Determines how the input data on the workfile is interpreted. Default value is taken from generation defaults but can be overridden here.
C | Decimal comma. The DECIMAL-POINT IS COMMA clause is set in the SPECIAL-NAMES paragraph of the corresponding COBOL program.
P | Decimal point.
Currency sign | The currency symbol in the PICTURE clause. Any currency symbol valid in COBOL can be used. The default is dollar.
Literal delimiter |
Literal delimiter character. Default value is taken from generation defaults but can be overridden here.
" | Double quotation mark. The compiler option QUOTE is used.
' | Single quotation mark. The compiler option APOST is used.
List |
Determines which columns of each COBOL line are listed. Valid values:
R | Columns 73-80 on the right are not listed.
L | Columns 1-6 on the left are not listed.
A | All columns will be listed. Only valid in batch mode.
Store |
Y | The generated file description will be incorporated in Predict.
N | File description will be displayed on screen, but not incorporated in Predict.
Replace |
Only valid if Store is set to Y. Valid values:
Y | Existing Predict file(s) and any dependent fields with same name will be replaced. Only files of type Conceptual, Other or Sequential will be replaced.
N | Error message will be given if file with same name exists, but dictionary objects will not be replaced. Default.
Input type |
W | Copy code is taken from Natural workfile 1.
I | Copy code is entered directly in the screen below. The last card must be END. For more information see your COBOL documentation. Note Sequence numbers are ignored.
Compiler |
Determines the type of compiler used. Default value is taken from generation defaults but can be overridden here.
7 | Standard COBOL 74 compiler is used.
8 | COBOL 85 compiler is used.
W | COBOL compiler for WANG is used.
Comment lines to |
Determines where comment lines in COBOL are written to.
A | Comments are written to the abstract of file/field object.
D | Comments are written to the extended description of file/field object.
RE-Group as Group |
Determines how redefining groups with name different to FILLER are handled.
Y | An additional group is created which holds the name.
N | The name is ignored (warning is shown). This is the default.

## Incorporating COBOL Copy Code in Batch Mode

Command: `INCORPORATE COBOL`

Enter parameters on next line using positional or keyword form.

Field | Keyword | Position
--- | --- | ---
File ID | FILE-ID | 1
Prefix | PREFIX | 2
Decimal character | DECIMAL-CHAR | 3
Currency sign | CURRENCY-SIGN | 4
List | LIST | 5
Store | STORE | 6
Replace | REPLACE | 7
Input type | INPUT-TYPE | 8
Literal delimiter | DELIMITER | 9
Compiler | COMPILER | 10
Comment lines to | COMMENT | 11
RE-Group as Group | RE-AS-GROUP | 12

## Representation of COBOL Field Definitions in Predict

The table below shows how COBOL data definitions are documented in Predict after incorporating COBOL copy code.

COBOL USAGE Clause | COBOL PICTURE Clause | COBOL Number of digits/bytes | Predict Format Length | Meaning * | For COBOL Compiler
--- | --- | --- | --- | --- | ---
BINARY | none |  |  | I | 2 | binary | WANG
BINARY | P S V 9 | 1-4 | 2 | I | 2 | binary | WANG
5-9 | 4 | I | 4
10-18 | 8 | I | 8
COMP | P S V 9 | 1-4 | 2 | I | 2 | binary |
5-9 | 4 | I | 4
10-18 | 8 | I | 8
|  | P or PS | nn.m | packed numeric binary | WANG
COMP-1 | not applicable |  |  | F | 4 | internal floating point short |
COMP-2 | not applicable |  |  | F | 8 | internal floating point long |
COMP-3 | P S V 9 |  |  | P or PS | nn.m | packed numeric binary |
COMP-4 | P S V 9 | 1-4 | 2 | I | 2 | binary |
5-9 | 4 | I | 4
10-18 | 8 | I | 8
DISPLAY | AB |  |  | A | nnnnn | alphabetic |
DISPLAY | A * 9 |  |  | A | nnnnn | alphanumeric |
DISPLAY | A * 9 B 0 / |  |  | A | nnnnn | alphanum. for print |
DISPLAY | A P V Z 9 0 / , . + - CR DB * $ |  |  | P or PS | nn.m | numerical for print |
DISPLAY | P S V 9 |  |  | N or NS | nn.m | decimal external |
DISPLAY | E V 9 . + - |  |  | F | 8 |  |
DISPLAY | V 9 for mantissa | 16 |  | F | 8 | floating point external |
DISPLAY | 99 for exponent | 2 |  | F | 8
INDEX | not applicable |  |  | not supported | Index |
PACKED- DECIMAL | P S V 9 |  |  | P or PS | nn.m | packed numeric binary | 85

* See the respective COBOL language description for more information on the different data formats.

### On this page

- Prerequisites for COBOL Copy Code
- Calling the Function
- Incorporating COBOL Copy Code in Batch Mode
- Representation of COBOL Field Definitions in Predict