Step by step As400-cobol Get started Tutorial 03-Data Department (original)

Source: Internet
Author: User

Role of the data division

All the data involved in the program (input, output, middle) are defined here, and their properties are described. The following properties are primarily described:

      • Data type (numeric/character) and storage format (length)
      • Relationships between data items (hierarchy and layer numbers)
      • FILE-to-record relationships

Data division can be divided into:

    • file section: used to describe the input and output files in the program and the properties of the data items in the record .
    • Unit of Work section (Working-storage) : used to describe intermediate data in a program
    • Join section linkage: A data item (that is, a parameter) used to describe data passing between the calling program

Structure diagram of the data section

File section

The data format for each input and output file in the program is described here, including:

    • File names and properties
    • The name of the record included in the file
    • Hierarchical relationship of data in each record
    • The format of each data item in the record and the size of the memory

Description of the file General format

FD file name (internal file name)

01 Record Name

05 data item 1 PIC ...

05 Data item 2 PIC ...

An FD statement is a file descriptor that describes the properties of a file and a record, such as the record name, format, and length .

All data groups and data items under the FD statement make up a record of the file.

Record Description: The record description begins with a 01-layer number followed by a record name. The data format used to define records, that is, the data type and length of each underlying data item. If the record itself is an elementary item, the record type and length are described after the record name.

Hierarchy Chart of records

Step by step As400-cobol Get started Tutorial 03-Data Department (original)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.