PROGRAM FILE INDEKS :
IDENTIFICATION DIVISION.
PROGRAM-ID. FILEINDEKS.
AUTHOR. ACA.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE-MHS ASSIGN TO DISK.
ORGANIZATION IS INDEXED.
ACCESS MODE IS SEQUENTIAL.
RECORD KEY IS NO-MHS.
FILE STATUS IS STATUS-SALAH.
DATA DIVISION.
FILE SECTION.
FD FILE-MHS.
LABEL RECORD IS STANDARD.
VALUE OF FILE-ID IS 'DAFMHS.DAT'.
DATA RECORD IS RECORD-MAHASISWA.
01 RECORD-MAHASISWA.
02 NO-MHS PIC 9(8).
02 NAMA-MHS PIC A(25).
02 ALAMAT-MHS.
03 JALAN PIC X(20).
03 KOTA PIC A(10).
02 TGL-DAFTAR.
03 TANGGAL PIC 99.
03 BULAN PIC 99.
03 TAHUN PIC 9999.
02 IP-MHS PIC X(25).
WORKING-STORAGE SECTION.
77 STATUS-SALAH PIC XX.
01 SUDAH-BENAR PIC X.
88 BENAR VALUE IS 'Y'.
88 BELUM VALUE IS 'T'.
01 MASUKKAN-LAGI-TIDAK PIC X.
88 LAGI VALUE IS 'Y', 'y'.
88 TIDAK VALUE IS 'T', 't'.
01 RECORD-MAHASISWA-MASUK.
02 NO-MHS-MASUK PIC 9(8).
02 NAMA-MHS-MASUK PIC A(25).
02 ALAMAT-MHS-MASUK.
03 JALAN-MASUK PIC X(20).
03 KOTA-MASUK PIC A(15).
02 TGL-DAFTAR-MASUK.
03 TANGGAL-MASUK PIC 99.
03 BULAN-MASUK PIC 99.
03 TAHUN-MASUK PIC 9999.
02 IP-MHS-MASUK PIC X(25).
SCREEN SECTION.
01 HAPUS-LAYAR.
02 BLANK SCREEN.
01 LAYAR-DATA.
02 LINE 4 COLOMN 5 'NOMOR IDENTITAS :'.
02 COLOMN PLUS 1 PIC 9(8) TO NO-MHS-MASUK REQUIRED.
02 LINE 6 COLOMN 5 'NAMA MAHASISWA :'.
02 COLOMN PLUS 1 PIC A(25) TO NAMA-MHS-MASUK.
02 LINE 8 COLOMN 5 'ALAMAT MAHASISWA :'.
02 LINE 10 COLOMN 5 'JALAN :'.
02 COLOMN PLUS 1 PIC X(20) TO JALAN-MASUK.
02 LINE 12 COLOMN 5 'KOTA :'.
02 COLOMN PLUS 1 PIC A(15) TO KOTA-MASUK.
02 LINE 14 COLOMN 5 'TANGGAL LAHIR :'.
02 COLOMN PLUS 1 PIC 99 TO TANGGAL-MASUK AUTO.
02 COLOMN PLUS 1 '/'.
02 COLOMN PLUS 1 PIC 99 TO BULAN-MASUK AUTO.
02 COLOMN PLUS 1 '/'.
02 COLOMN PLUS 1 PIC 9999 TO TAHUN-MASUK AUTO.
02 LINE 18 COLOMN 5 'HOBBY :'.
02 COLOMN PLUS 1 PIC A(25) TO IP-MHS-MASUK.
PROCEDURE DIVISION.
RUTIN-UTAMA SECTION.
BUKA-FILE.
OPEN OUTPUT FILE-MHS.
MULAI.
MOVE SPACE TO SUDAH-BENAR
PERFORM MASUKKAN-DATA UNTIL BENAR
PERFORM REKAM-DATA
PERFORM ADA-LAGI-TIDAK.
SELEKSI-MASUKKAN-LAGI-TIDAK.
SELESAI.
CLOSE FILE-MHS.
STOP RUN.
RUTIN-BAGIAN SECTION.
MASUKKAN-DATA.
DISPLAY HAPUS-LAYAR.
DISPLAY LAYAR-DATA.
ACCEPT LAYAR-DATA.
DISPLAY (20,5) 'APAKAH SUDAH BENAR (Y/T) ?'.
ACCEPT ( , ) SUDAH-BENAR.
REKAM-DATA.
MOVE '' TO STATUS-SALAH.
WRITE RECORD-MAHASISWA FROM RECORD-MAHASISWA-MASUK.
ADA-LAGI-TIDAK.
DISPLAY (22,5) 'ADA LAGI DATA YANG LAIN (Y/T) ?'.
ACCEPT ( , ) MASUKKAN-LAGI-TIDAK.
IF 'Y' GO TO MULAI.
IF 'T' GO TO SELESAI.
0 komentar:
Post a Comment