Step by step As400-cobol Getting Started Tutorial 01-Basic Concept (original)

Source: Internet
Author: User

Learn Basic Concepts First

1.COBOL character : contains:

    1. user-defined words user-defined characters
    2. ? System-names
    3. ? Reserved words keywords

2. user-defined character user-defined words: Legal definition:

    1. ? A-Z
    2. ? A-Z
    3. ? 0-9
    4. ? -(hyphen).

3. System name system-names

    1. Computer-names
    2. ? Language-names
    3. ? Implementor-names:
      1. Environment-name
      2. Assignment-name

4. keyword Reserved words

acceptaccessacquire addaddress advancingafterallalphabetalphabeticalphabetic-loweralphabetic-Upperalphanumericalphanumeric-editedalsoalteralternateandany areareaareasarithmetic Ascendingassignatauthorauto AUTO-SKIP BACKGROUND-COLOR BACKGROUND-Colour B-and BEEP Beforebell B-EXOR binarybit BITS blankb-Less BLINK blockb-Not BOOLEAN B-OR bottombycallcancelcd CF CH charactercharactersclassclock-UNITS closecobol Code code-Setcol Collatingcolumn commacommit Commitment COMMON Communication Compcomp-3COMP-4computationalcomputational-3Computational-4computeconfigurationconnect CONTAINED Containscontentcontinuecontrolcontrol-Area controlsconversion convertingcopycorrcorrespondingcountcrt CRT-under Currencycurrent CURSOR datadatedate-compileddate-Writtendayday-of-WEEK DB DB-access-control-KEY DB-data-NAME DB-EXCEPTION DB-format-NAME DB-record-NAME DB-set-NAME DB-STATUS DBCS DE DEBUG-Contentsdebug-Itemdebug-Linedebug-Namedebug-sub-1DEBUG-sub-2DEBUG-sub-3Debuggingdecimal-pointdeclarativesdefault deletedelimiteddelimiterdependingdescendingdestination DETAIL DISABLE DISCONNECT Displaydisplay-1DISPLAY-n dividedivisiondowndrop DUPLICATE duplicatesdynamicegi EJECT elseemi EMPTY-CHECK ENABLE endend-ACCEPT END-ADDEND-Callend-Computeend-DeleteEnd-Divideend-Evaluateend-IfEnd-Multiplyend-of-Pageend-Performend-Readend-RECEIVE END-Returnend-Rewriteend-Searchend-StartEnd-Stringend-Subtractend-Unstringend-writeenterenvironmenteopequalequals ERASE erroresi evaluateeveryexceeds exceptionexclusive EXITEXOR Extendexternal Externally-described-KEY FALSE fdfetch filefile-controlfiles fillerfinal FIND FINISH firstfootingforforeground-COLOR FOREGROUND-colour FORMAT free fromfull FUNCTION generateget givingglobal gogoback greatergroup HEADING HIGHLIGHT High-Valuehigh-Valuesi-OI-o-CONTROLID Identificationifinindexindexedindex-N indic indicateindicator indicators initialinitializeinitiateinputinput-outputinspectinstallationintoinvalidisjustjustifiedkeep keylabellastld leadingleftleft-JUSTIFY lengthlength-CHECK lesslike LIMIT LIMITS linagelinage-Counterlineline-COUNTER lineslinkagelocally Locklow-Valuelow-valuesmember memorymergemessage modemodified MODIFY modulesmovemultiplemultiplynativenegativenextnono-ECHO NONE notnull NULLS number Numericnumeric-Editedobject-computeroccursofoffomittedononly openoptionalororderorganizationother Outputoverflowowner PACKED-decimalpadding pagepage-COUNTER Performpf PH picpictureplus pointerpositionpositivepresent printingprior Procedureproceduresproceedprocess Programprogram-idprompt PROTECTED PURGE QUEUE quotequotesrandomrd readready REALM RECEIVE Reconnect Recordrecord-NAME recordsredefinesreelreferencereference-MONITOR referencesrelation relativereleaseremainderremovalrenamesrepeated REPLACE replacingreport REPORTING REPORTS REQUIRED rerunreservereset Retaining retrieval Returnreturn-CODE Reversedreverse-VIDEO rewindrewriterd RF RH RIGHTRIGHT-JUSTIFY ROLLBACK rolling roundedrunsamescreen sdsearchsectionsecure securitysegment SEGMENT-limitselectsend sentenceseparatesequencesequentialsetshared SIGNSIZESKIP1 SKIP2 SKIP3 sortsort-MergeSort-RETURN Source Source-Computerspacespace-FILL spacesspecial-Namesstandardstandard-1 Standard-2startstarting Statusstopstore stringsub-queue-1SUB-queue-2SUB-queue-3SUB-SCHEMA subfile subtractsum suppresssymbolic syncsynchronizedtable tallyingtapetenant terminalterminate TESTTEXT Thanthenthroughthrutimetimestitle totoptrailingtrailing-Sign TRANSACTION TRUETYPE underline unequal unitunstringuntilupupdate uponusageusage-MODE useusingvalid VALIDATE valuevaluesvaryingwait whenwhen-COMPILED Withwithin wordsworking-Storagewritezerozeroeszero-FILL Zeros<< =+***-/>> = =
View Code

Nearly 500 keywords.

5, section and segment Sections and paragraphs

Level:

? Identification Division
Paragraphs
Entries
Clauses
? Environment Division
Sections
Paragraphs
Entries
Clauses
Phrases
? Data Division
Sections
Entries
Clauses
Phrases
? Procedure Division
Sections
Paragraphs
Sentences
Statements
Phrases

Note:

4 Departments:

    • 1, Identification Department (identificationdivision): Used to identify the program name.
    • 2. Ministry of Environment (ENVIRONMENTDIVISION): The environment used to illustrate the operation of the program.
    • 3. Data Department (datadivision): Used to describe all the data involved in the program.
    • 4, Process Department (proceduredivision): Is the core part of the program, it determines what the computer should do.


Part (division) may include several sections
Sections section can contain several segments
Paragraph (Paragraph) can contain several sentences
Sentence (sentence) A sentence can contain several statements
Statement (Statement) to make a computer complete certain operations
Clause (Clause) to develop a function to accomplish a certain aspect

6. Cobol Code format

The 1th to 6th column "label area" serial number is optional.if used, the serial number must bein columns 1 to 67th column "Continuation of the marked area"
8th to this 11 column, called "a zone". Some contents of the program such as head, section head, segment head, layer number 01, Layer number 77 and file descriptor FD should be written from area A.
12th to this 72 column, called "Zone B". Writes the body part of the program. Sentences in the process department can only be written from area B.
The 73rd to 80th column, called the annotation area.

Format Demo:

Step by step As400-cobol Getting Started Tutorial 01-Basic Concept (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.