This article has not yet passed wikiHow's quality review process. Learn more
Edit Article

The importance of knowing COBOL is quite beneficial even if the language is fifty years old. The language is still being used today to store data in our governments, banks and businesses with little to no signs of changing to newer languages. COBOL programming with DB2 can be very frustrating to learn but the underlying concepts are easier than our thinking and with time anyone can learn it.

Ok,
Close
This article has not yet passed wikiHow's quality review process. Learn more

Headline text

  1. COBOL programs are hierarchical in structure. Each element of the hierarchy consists of one or more subordinate elements. The hierarchy consists of Divisions, Sections, Paragraphs, Sentences and Statements. A Division may contain one or more Sections, a Section one or more Paragraphs, a Paragraph one or more Sentences and a Sentence one or more Statements. We can represent the COBOL hierarchy using the COBOL metalanguage as the below picture.

Steps

  1. 1
    To describe the IDENTIFICATION DIVISION supplies information about the program to the programmer and the compiler.
  2. 2
    To write the ENVIRONMENT DIVISION is used to describe the environment in which the program will run. The purpose of this division is to isolate in one place all aspects of the program that are dependant upon a specific computer, device or ending sequence.
  3. 3
    DATA DIVISION - descriptions of the data-information processed by the program. FILE SECTION and WORKING-STORAGE SECTION are included. The LINKAGE SECTION and the REPORT SECTION are additional sections
  4. 4
    Procedure Division - contains the code(To manipulate the data in the DATA DIVISION)
  5. 5
    Minimum COBOL program - For example, the above program is valid when compiled with the Microfocus NetExpress compiler.
  6. 6
    COBOL DB2 PROGRAMMING - Assume we have the following table in DB2(database)
  7. 7
    To declare the table in the WORKING-STORAGE SECTION or LINKAGE SECTION. If you create a copybook using DCLGEN. You can declare as the below simply.

  8. 8
    Host variable declaration VS DB2 - If you use DB2 tool DCLGEN, it will automatically creates this structure and table declaration specified in the table declaration of WORKING-STORAGE SECTION.
  9. 9
    SQLCA in WORKING-STORAGE SECTION
  10. 10
    DB2 sql statement in the PROCECURE DIVISION
  11. 11
    As the above steps, we have completed coding a COBOL-DB2 program.

We could really use your help!

Can you tell us about
relationships?
Can you help us
rate articles?
Yes
No
relationships
how to win a girl over
Can you tell us about
astrology relationships?
Yes
No
astrology relationships
how to attract Scorpio guys
Can you tell us about
tying yourself up with rope?
Yes
No
tying yourself up with rope
how to tie yourself up with rope
Can you tell us about
fashion?
Yes
No
fashion
how to create the perfect outfit
Thanks for helping! Please tell us everything you know about
...
Tell us everything you know here. Remember, more detail is better.
Tips
Provide Details.
Please be as detailed as possible in your explanation. Don't worry about formatting! We'll take care of it. For example:
Don't say: Eat more fats.
Do say: Add fats with some nutritional value to the foods you already eat. Try olive oil, butter, avocado, and mayonnaise.

Article Info

Categories: Cleanup | Programming

Thanks to all authors for creating a page that has been read 223 times.

Did this article help you?
Yes No