12.03.2011

Program Sequential menggunakan Cobol


Program Sequential menggunakan cobol ;


IDENTIFICATION DIVISION.
PROGRAM-ID. SEQUEN1.
AUTHOR.
SECURITY. PROGRAM MEMASUKKAN DATA SEQUENSIAL.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT PENJUALAN ASSIGN TO DISK.
ORGANIZATION IS SEQUENTIAL.
FILE STATUS IS STATUS-SALAH.
DATA DIVISION.
FILE SECTION.
FD PENJUALAN
LABEL RECORD IS STANDARD.
VALUE OF FILE-ID ID 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 ‘NOMOR FAKTUR :’.
02 COLUMN PLUS 1 PIC X(22) TO NOMER-FAKTUR REQUIRED.
02 LINE 6 COLUMN 5 ‘NAMA LANGGANAN :’.
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.
RYTIN-UTAMA SECTION.
BIKA-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 PENUALAN
STOP RUN.
RUTIN-BAGIAN SECTION.
MASUKKAN-DATA.
DISPLAY HAPUS-LAYAR
DISPLAY LAYAR-DATA
ACCEPT LAYA-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 (20,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,6) ‘STURKTUR FILE RUSAK’.

Tidak ada komentar:

Posting Komentar