Flowchart Update Data File Sequential dan Contoh Programnya

FLOWCHART :
Program Sekeunsial Pada COBOL :
IDENTIFICATION DIVISION .
PROGRAM – ID. SEQUEL .
AUTHOR . JOGIYANTO HM .
SECURITY . PROGRAM MEMASUKAN DATA ORGANISASI FILE SEQUENTIAL
ENVIRONMENT DIVISION .
INPUT – OUTPUT SECTION .
FILE – CONTROL.
SELECT PENJUALAN ASSIGN TO DISK.
ORGANIZATION IS SEQUENTIAL.
ACCESS MODE IS SEQUENTIAL.
FILE STATUS IS STATUS – SALAH .
DATA DIVISION .
FILE SECTION .
FD PENJUALAN.
LABEL RECORD IS STANDARD.
VALUE OF FILE – ID IS ‘ JUAL . DAT ‘
DATA RECORD IS RECORD – RELASI .
01 DATA – PENJUALAN .
02 NOMER – FAKTUR PIC X ( 12 ) .
02 NAMA – LANGGANAN PIC X ( 25 ) .
02 KODE – JUAL PIC A .
88 TUNAI VALUE IS ‘ T ‘ .
88 KREDIT VALUE IS ‘ K ‘ .
02 NILAI – JUAL PIC 9 ( 6 ) .
WORKING – STORAGE SECTION .
77 STATUS – SALAH PIC XX .
01 SUDAH – BENAR PIC X .
88 BENAR VALUE ‘ Y ‘ , ‘ y ‘ .
88 BELUM VALUE ‘ T ‘ , ‘ t ‘ .
01 MASUKKAN – LAGI – TIDAK PIC X .
88 LAGI VALUE ‘ Y ‘ , ‘ y ‘ .
88 TIDAK VALUE ‘ T ‘ , ‘ t ‘ .
SCREEN SECTION .
01 HAPUS LAYAR .
02 BLANK SCREEN .
01 LAYAR – DATA .
02 LINE 4 COLUMN 5 ‘ NOMER FAKTUR
02 COLUMN PLUS 1 PIC X ( 12 ) TO NOMER – FAKTUR  REQUIRED .
02 LINE 6 COLUMN 5 ‘ NAMA LANGGANAN .
02 COLUMN PLUS 1 PIC X ( 25 ) TO NAMA – LANGGANAN .
02 LINE 8 COLUMN 5 ‘ KODE TRANSAKSI
02 COLUMN PLUS 1 PIC A TO KODE – JUAL .
02 LINE 10 COLUMN 5 ‘ NILAI PENJUALAN .
02 COLUMN PLUS 1 PIC 9 ( 6 ) TO NILAI – JUAL .
PROCEDURE DIVISION .
RUTIN – UTAMA SECTION .
BUKA – FILE .
OPEN OUTPUT PENJUALAN .
MULAI .
MOVE SPACE TO SUDAH – BENAR
PERFORM MASUKKAN – DATA UNTIL BENAR
PERFORM REKAM – DATA
PERFORM ADA – LAGI – TIDAK .
SELEKSI – MASUKKAN – LAGI – TIDAK .
IF LAGI
GO TO MULAI .
SELESAI .
CLOSE PENJUALAN
STOP RUN .
RUTIN – BAGIAN SECTION .
MASUKKAN – DATA .
DISPLAY HAPUS – LAYAR
DISPLAY LAYAR – DATA
ACCEPT LAYAR – DATA .
DISPLAY ( 18 , 5 ) ‘ SUDAH BENAR ( Y / T ) ? ‘
ACCEPT ( , ) SUDAH – BENAR .
REKAM – DATA .
MOVE ‘ ‘ TO STATUS – SALAH.
WRITE DATA – PENJUALAN.
PERFORM SELEKSI – REKAMAN .
ADA – LAGI – TIDAK .
DISPLAY ( 10 , 5 ) ‘ ADA LAGI DATA LAINNYA ( Y / T ) ? ‘.
ACCEPT ( , ) MASUKKAN – LAGI – TIDAK .
SELEKSI – REKAMAN .
IF STATUS – SALAH = ‘ 34 ‘.
DISPLAY ( 18 , 5 ) ‘ TIDAK TEREKAM , DISK PENUH ‘ .
IF STATUS – SALAH = ‘ 91 ‘.
DISPLAY ( 18 , 5 ) ‘ STRUKTUR FILE RUSAK ‘ .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s