1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Gnu-COBOL プログラムの基本構造

1
Last updated at Posted at 2020-08-29
*> コメント
*> 昔は大文字でしか記述できなかったが今は小文字もok
*> 文の最後は「.」
*> DIVISION > SECTION

*> 4つのDIVISION
*> 「見出し部」 → 「環境部」 → 「データ部」 → 「手続き部」の順番で記述

*> 見出し部
IDENTIFICATION DIVISON.
PROGRAM-ID. HELLO.

*> 環境部
ENVIRONMENT DIVISION.

*> データ部
DATA DIVISION.

*> 手続き部
PROCEDURE DIVISION.

PROCEDURE DIVISION. *> コメント
  MAIN SECTION.
    DISPLAY 'hello world!'. *> DISPLAY -> 何かを表示する
    STOP RUN.               *> STOP RUN. -> 処理を止める

DIVISION 記述 概要
見出し部 IDENTIFICATION DIVISON. PROGRAM-ID.を記述
省略不可
環境部 ENVIRONMENT DIVISION. 実行環境、入出力ファイルの情報を記述
省略可
データ部 DATA DIVISION. 入出力ファイルの情報、変数の定義
省略可
手続き部 PROCEDURE DIVISION. 処理を記述。
SECTION.を作成しその下に処理を書く
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?