Pages

Kamis, 10 November 2011

 IDENTIFICATION DIVISION.
       PROGRAM-ID. SQUENANNA.
       AUTHOR.
       SECURITY. PROGRAM MEMASUKAN DATA SEQUENSIAL.
       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 MASUKAN-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 MASUKAN-DATA UNTIL BENAR.
           PERFORM REKAM-DATA.
           PERFORM ADA-LAGI-TIDAK.
       SELEKSI-MASUKAN-LAGI-TIDAK.
           IF LAGI GO TO MULAI.
       SELESAI.
           CLOSE PENJUALAN.
           STOP ' '.
           STOP RUN.
       RUTIN-BAGIAN SECTION.
       MASUKAN-DATA.
           DISPLAY HAPUS-LAYAR.
           DISPLAY LAYAR-DATA.
           ACCEPT LAYAR-DATA.
           DISPLAY (18,5) 'SUDAH BENAR (Y/T) ?'.
           ACCEPT (,) SUDAH-BENAR.
           STOP ' '.
           STOP RUN.
       REKAM-DATA.
           MOVE '' TO STATUS-SALAH.
           WRITE DATA-PENJUALAN.
           PERFORM SELEKSI-REKAMAN.
       ADA-LAGI-TIDAK.
           DISPLAY (10,5) 'ADA LAGI DATA (Y/T) ?'.
           ACCEPT (,) MASUKAN-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'.

0 komentar:

Posting Komentar

 
Copyright (c) 2010 PIPIT's Blog. Design by Wordpress Themes.

Themes Lovers, Download Blogger Templates And Blogger Templates.