selamat datang di blogku "my virtual"

Selasa, 05 Oktober 2010

PROCEDURE DIVISION


            Procedure Division is the description logic which is used to solve the problem, so that this division is the core of the COBOL program.
As for that special statement used on this division include:
OPEN, READ, WRITE, rewrite, CLOSE.
General form:
PROCEDURE DIVISION.
[Open-file]
[Print-title]
[Flow process]
[Close the file]

OPEN verb
Used to open a file that will be accessed.
General form:

INPUT-name file1 [, name-file2] ....
File3 output-name [, name-file4] ....
OPEN IO-file5 name [, name-file6] ....
Extend-file7 name [, name-file8] ....

Description:
- OPEN INPUT
Indicate the file will be opened as input file, or data that will be read (READ) of this file.
- OPEN OUTPUT
Indicate the file will open as the output file or data that will be recorded (WRITE) pd this file. If you have any previous data, the new data will be recorded and distinguished old data will be erased.
If you want to add data to a file that already contains data, the file must be opened with the OPEN Extend
- OPEN I-O
Indicates the file is opened as a file-input and-output as well as files, ie files opened for input & output destination as well as can be read and modified.

OPEN statement
to prepare / open a file that is used in the program.
General form:
INPUT filename
OPEN OUTPUT file-name
I-O filename
Example:
OPEN INPUT FILE-MHS
OUTPUT REPORT-MHS.
OPEN HOME I-O-MHS.

Tidak ada komentar:

Posting Komentar