COBOL (Note 1)

Source: Internet
Author: User

The first time I got in touch with Cobol today, the lecturer was an English speaker. It was really hard to take the course. Alas .... the English is not good. There are two books in China that feel okay, the simple guide of COBOL and the programming language design of COBOL (TAN haoqiang)

The following is the first program and a hello program. The tool is

First open programming-staff, file --> New the editor area appears, file --> New write your program, save and close, return to programming-staff and select wincob under the Tools menu --> source file --> OK. The MSG prompt is displayed. Statistics: highest severity code = I, Program unit = 1.
Indicates correct compilation

Next, choose Tools menu in programming-staff, winlink --> link file input box input file such as: C:/cobolsource/PROG-2.OBJ here in the target input box will appear the same file path, at this time, I changed the cobolsource to cobolload. If I didn't change it, the operation was unemployed and the cobolload folder should be created first. click OK to open a new window and close other Windows except the staff window.

Next step. tools --> winexec --> in the command line box, enter your link-based file name. For example, if my file is C:/cobolload/PROG-2.EXE --> click OK, when a new window appears, select the items you want in the List table. I am currently using @ iconname = cob85exe. I am not quite clear about other items. I cannot use the lecturer's language. --> OK run

Save the file name as prog1

@ Options main
Identification Division.
Program-id. prog1
Author. Jeff
Environment Division.
Configuration section.
Source-computer. IBM-PC.
Object-computer. IBM-PC.
Input-output section.
Select in-file assign "input. txt"
Organization line sequential.
Data Division.
FILE Section.
FD in-file.
01 In-record picture X (80 ).
Procedure division.
Open input in-file.
Read in-file.
Display in-record.
Close in-file.
Stop run.

The file name saved by the hello program is "hello ".

@ Options main
Identification Division.
Program-ID hello.
Author. LiuYa
Environment Division.
Data Division.
Procedure division.
Display "Hello COBOL ".
Stop run.

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: 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.