CHAPTER 4 Data of the Ministry of

2011-06-01  来源:本站原创  分类:Tech  人气:185 

One. Data Division Overview.
1. Ministry's role is to define the data item attribute data, describe data structures. Ministry in the process of all data items that appear in the data must be in the Department are described on their properties. Including the type of data items, the relationship between data items, records and documents the relationship between the attributes of files.
2. Data layers and layer number: COBOL in a subordinate relationship to the data with the level (level) to describe the relationship. Data hierarchy is: record - "Combination item -" the beginning of other items. For example, in previous statements as defined in READ IN-FILE file has the following structure:
01 IN-RECORD.
02 PROD-CODE PIC 9 (4).
02 PROD-QUANT ITY PIC 9 (5).
02 PROD-PRICE PIC 9 (6).
02 MANU-DATE.
05 DATE-CCYY PIC 9 (4).
05 DATE-MM PIC 9 (2).
05 DATE-DD PIC 9 (2).
Levels as follows:
(1) is used to describe the data layer of the hierarchy of the number from 01 to 49. Recorded the highest level, as the No. 01 level.
(2) subordinate entry level number than the number under the entry level high. No. not requiring continuous layer.
(3) subject to the same combination of items, but not subordinate to each other have the same layer of the data item number.
3. Ministry data structure: data usually used in the Department has the following sections:
(1) FILE SECTION: description of procedures used in the input and output files and records of the properties of each data item.
(2) WORKING-STORAGE SECTION: description of procedures used in the middle of the data item.
(3) LINKAGE SECTION: occurring between the caller describes the data and pass the data item.
(4) REPORT SECTION: In order to complete the preparation of the report features, like the provisions of this section is used to report output
'Genre', the design of the report group forms and methods of printing.
II. File section.
1. File section of the role: a program for each input or output file should be described in the file section. Include: the file name and file properties; file name, including the records; each record in the data hierarchy; record the data in the form of the data items and the total memory size.
2. File Description: The most simple document describes the general format of the body:
FD filename
LABLE RECORD IS STANDARD
RECORDS ARE OMITTED
DATA RECORD IS data name
RECORDS ARE
3. Records Description: The records describe the body begin on the 01 level, followed by the record name. If the record itself is a beginning of other items, after the name in the record description of the record length; Otherwise, the data were followed by a period, the following data structure defined record. Such as:
DATA DIVISION.
FILE SECTION.
FD IN-FILE
LABLE RECORD IS STANDARD.
DATA RECORD IS IN-FILE-RECORD.
01 IN-FILE-RE CORD PIC X (80).
DATA DIVISION.
FILE SECTION.
FD IN-FILE
LABLE RECORD IS STANDARD.
DATA RECORD IS IN-FILE-RECORD.
01 IN-FILE-RE CORD PIC X (80).
Or (01 IN-FILE-RE CORD.
05 DATE PIC 9 (8).
05 PROD-CODE PIC 9 (4).
05 PROD-PRICE PIC 9 (6). )
4. Data item description: In the beginning of each name followed by other items of a PIC clause. Use it to describe the data type and length. PIC clause in the following details.
5. File section of the written format: FD A, starting from the writing, No. 01 level starting from A, the other layer number from the A, B, also available from the start. To look structured, the best start from the B zone.
III. PIC clause. PIC is the abbreviation for PICTURE. PIC clause is used to describe the beginning of every other items. It shows that: (1) what type of data item. (2) how much total data item memory domain. (3) whether the requirements of preparing for the press to print characters. PIC clause is to describe a major role in the beginning of other items of general characteristics and editing requirements.
1. Description of numeric data:
'9 'Descriptor: that can be placed in the position of a number between 0 and 9. Therefore:
01 A PIC 999. Or
01 A PIC 9 (3).
That A can store between 000 to 999, a three-digit. Several said there are several number 9.
Note: (1) numeric data item can only be put in the figures can not put spaces.
(2) The '9 'descriptor can represent integers, such as the decimal part, the fractional part is discarded.
(3) into a negative number, then the negative sign is discarded.

'V' descriptor: data structure that implicit in the numerical position of the decimal point. Decimal point does not account for the memory unit. Such as:
03 M PIC 9 (3) V9 (2).
Note: (1) V in the last descriptor is equal to no decimal point.
(2) a data descriptor can only see a V.
(3) for data transmission or operation, press the implied decimal point position alignment for delivery or operation.
(4) V represents the decimal point when the only role in the transmission or the operation can not be displayed or printed.

'S' descriptor: If you want the data item into a signed number, you can use 'S' descriptor. Such as:
03 M PIC S9 (3) V9 (2).
Note: (1) S descriptor must be the most left one descriptor.
(2) in memory, S does not account for the median, when the work in the transmission or operations.
2. Letter-type data, description: Type the letters A descriptor with the data item, in this type of data items in the store only letters or spaces.
3. Description of character data: COBOL characters from the arbitrary data, known as character data, it is non-numeric and can not be used for calculations. X-descriptors to represent character data. Such as:
03 M PIC X (5).
Note: (1) X character data can be used descriptors 9 and A can also be used to describe the descriptors. Such as the description of the data 'COB-74' can use PIC X (6), can also be used PIC A (3) X9 (2).
(2) The type of data can either use the letters A description can also use X.
(3) the character data in the figures can be released.
4. Edit type descriptor: Editor-type data items as output data only when required to add or change some symbols from the editor role, it is not used for the calculation. The following items were introduced in the edit data edit descriptor used.
(1). Insert a decimal point '. ', With'. 'Descriptor. Such as:
77 T PIC 99. 99.
(2). Insert a comma ',' for the sub-bit number, with ',' descriptor. Such as:
02 A PIC 999,999. 99. (Or PIC 9 (3), 9 (3). 9 (2))
(3). Insert a space, with the 'B' descriptor. Such as:
02 A PIC B9 (3) B.
(4). Into the sign, with '+' or '-' descriptor. Such as:
02 A1 PIC +9 (3). (Or PIC 9 (3) +)
02 A2 PIC -9 (3). (Or PIC 9 (3) -)
Note: The descriptor '+', a Lu-plus-sign. Descriptor '-' only negative plus a negative number.
(5). Insert the '$'. Such as:
02 A1 PIC $ 999. 99.
02 A2 PIC + $ 99999.
02 A3 PIC - $ 999. 9.
(6). Floating into the sign and the '$'
02 A1 PIC $ $ $ 99.99.
02 A2 PIC $$$$$.$$.
02 A3 PIC + +9.99.

(7). Cancel the high zero, with 'Z' and '*' descriptors. Zero in the high position of the previous generation with a space or '*'. Such as:
02 A1 PIC Z (5). 99.
02 A2 PIC * (5). * (2).
02 A3 PIC + ZZZ, ZZZ, ZZ. ZZ.
02 A4 PIC -*,***,***。 99.
(8). Into the 'DB' and 'CR' character. DB and CR can only be used as a fixed insert, when the value is negative, the type of data item in the editor the last two bytes set to DB or CR, value is positive, the two-byte spaces. Such as:
02 A1 PIC $ 9 (3). 99DB
02 A2 PIC $ 9 (3). 99CR.
5. Frequently used numerical data
CHAPTER 4 Data of the Ministry of

IV. Unit of work section (WORKING-STORAGE SECTION)

1. The role of unit of work section: program using the data item is divided into two parts, one belonging to the input or output file, another part of the non-input or output data. If some intermediate variables or data items such as cumulative. The data input and output of non-working unit should be described in Section, a unit of work can also be used to assign initial section.
2. VALUE clause: for the initial values ​​to variables. Such as:
02 A PIC 9 (3) VALUE 123.
Note: (1) unit of work only on the data entry section to assign the initial value, not the section of the file input and output files in the initial values ​​of data items.
(2) If the description of items in the combined use of the body of VALUE, the initial value can only be constant or non-ideographic numeric constants. Combination of items on the whole, be handled by character data entry.
(3) When using a signed for the initial value, the corresponding PIC clause should be 'S' descriptor.
(4) assign the initial value should pay attention to the type of consistency.
(5) VALUE clause, the value given in the description should be suitable for PIC clause, or else there will be truncated or generated an error.

相关文章
  • CHAPTER 4 Data of the Ministry of 2011-06-01

    One. Data Division Overview. 1. Ministry's role is to define the data item attribute data, describe data structures. Ministry in the process of all data items that appear in the data must be in the Department are described on their properties. Includ

  • Chapter summary data structure based on knowledge of data structures (1) 2010-05-31

    Abstract data types (Abstract Data Type, ADT) is a logical concept of the type and the type of operations on sets. The logical structure of data 1. Linear structure: The data element is only a precursor of a subsequent data elements and data elements

  • Chapter III data communications and computer networks 2010-09-05

    Internet based protocol IP protocol: unreliable, connectionless protocol IP address of all 0 represents the network, a representative of the entire broadcast, IP address length of 32 bits, divided into network number and host number two parts, the ne

  • CHAPTER 2 during the course of the Department of the Ministry of the initial basic statement ----- 2011-06-01

    One. Input and output statements. 1. ACCEPT statement: the system directly from the terminal keyboard or input device on the specified input data. ACCEPT identifier [FROM mnemonic name] Note: A. Identifier (identifier) ​​that is able to uniquely iden

  • Dinner and workflow data patterns 2010-03-06

    And the previous chapter, we start with the beginning of a story, the story and dinner. In my home, Mon-Fri, wife to cook, I wash. Finish the meal every day, my wife will call me into the kitchen and said, look, this dish to wash the other, dirty sto

  • Data Mining Algorithms and Applications [change] 2010-04-14

    Book report research frontier Data Mining Algorithms and Applications Directory Chapter 5 Data Warehouse ... 1.1 Introduction ... 5 Data Warehouse Architecture 1.2 ... 6 1.3 Data warehouse planning, design and development ... 7 1.3.1 Scoping ... 7 1.

  • memcache counter and data compression to achieve 2010-07-14

    A: Access Statistics / / Access statistics $ Memcache = new Memcache; $ Memcache-> connect ('localhost', 11211) or die ("Could not connect"); if ($ s = $ memcache-> get ('a')) ( $ S = $ s +1; $ Memcache-> set ('a', $ s); ) else $ Memcac

  • CHAPTER 5 during the Second Department of 2011-06-01

    One. MOVE statement, the higher skills 1. Rules of various types of data transfer between the table below: (Y: that the legal transfer. N: that the illegal transfer. Empty: that is legal in some time.) Reception items Numeric Numeric Edit-type numeri

  • "Let Oracle run faster 2 - mass data based on database design and optimization> 2011-08-02

    "Let the Oracle run faster 2-- mass data based on database design and optimization." Editor's Choice To the first author of the work experience of 10 years to build massive data-based database design and optimization of books Basic information A

  • Learn JavaScript 2009-05-03

    JavaScript programming book (2nd edition) The first part of basic grammar chapter JavaScript Introduction JavaScript is a small, lightweight, object-oriented, cross-platform scripting language, is the most popular web page programming language client

  • The Ruby Programming Language Introduction 2009-05-19

    Click here to download chm part1 Click here to download pdf Click here to download chm part2 Tip: chm version 【Description】 Details of the book Ruby 1.8 and 1.9 versions of the various aspects. Ruby in a brief summary, the book details the following:

  • JAVA materials (recommended novice learning) 2009-07-26

    The contents of a very comprehensive JAVA materials, from J2SE to J2EE, easy-to-digest and explain, very suitable for beginners Contents Chapter I: Java started 1 Learning Objective 1 Java History 2 Java Technical Overview 3 3 advantages of Java tech

  • php Notes (only for individuals not familiar with the content knowledge. continued -) 2010-03-01

    Chapter PHP Quick Start Tutorial 1, php, no matter what style of comment, the comment symbol (# or / /) after the end line, or the php closing tag was all before the comment. Cases: / / here is a comment?> Here is not For only "here is a comment&q

  • [Original] Oracle9i Concepts bilingual C1.1 2010-02-26

    The first translation, for learning purposes, there is an error, please correct me, thank you! Oracle9iR2.Database.Concepts 1 Oracle Server Introduction This chapter outlines for the Oracle server, including the following topics: _ Database Structure

  • [Original] Oracle9i Concepts bilingual C1.3 2010-03-10

    Data Utilities Data Utility The three utilities for moving a subset of an Oracle database from one database to another are Export, Import, and SQL * Loader. Oracle has three useful programs, they can be part of the data transfer database to another O

  • Introduction to PHP + MYSQL web design practice [2.49G] Download 2010-04-29

    I Theoretical articles Chapter I understand PHP (origin, characteristics, and ASP / ASP.NET and JAVA comparison, PHP environment deployment, IDE) Chapter II Chapter III PHP PHP grammar library chapter about MySQL MySQL Language Structure Chapter V Ch

  • Introduction to PHP + MYSQL web site design practices [2.49G] Download 2010-04-29

    I Theoretical articles Chapter I understand PHP (origin, characteristics, and ASP / ASP.NET and JAVA comparison, PHP environment deployment, IDE) Chapter II Chapter III PHP PHP grammar library chapter about MySQL MySQL Language Structure Chapter V Ch

  • Collection of commonly used commands DBA 2010-05-21

    Chapter One: Log Management 1.forcing log switches sql> alter system switch logfile; 2.forcing checkpoints sql> alter system checkpoint; 3.adding online redo log groups sql> alter database add logfile [group 4] sql> ('/ disk3/log4a.rdo', '/ di

  • UNIX Network Programming. Volume 1, socket networking API (3rd Edition) (English Version) (Stevens classic, the two leading network programming experts were invited to write Amendment) 2010-07-01

    UNIX Network Programming. Volume 1, socket networking API (3rd Edition) (English Version) (Stevens classic, the two leading network programming experts were invited to write Amendment) Basic Information Original title: Unix Network Programming, Volum

  • <Search Engine-Application. Practice and Application> read summary 2010-09-12

    Recently looked at the "search engine - application, practice and application," This book, which can be counted as a search engine entry books, this book was good, deep to shallow. Which although not very deep, but the basic cover of the current