" Coding File Sequential "
IDENTIFICATION DIVISION.
PROGRAM-ID. TUGAS6.
AUTHOR. ASEP.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT COBA ASSIGN TO DISK
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD COBA
LABEL RECORD IS STANDARD
VALUE OF FILE-ID IS "GILA.DAT"
DATA RECORD IS PEGAWAI.
01 PEGAWAI.
02 NM PIC X(10).
02 NPM PIC X(8).
02 STA PIC X(10).
02 GLO PIC X.
02 GJ PIC X(10).
WORKING-STORAGE SECTION.
01 ULANG.
02 DATA1 OCCURS 99 TIMES.
03 NAPEG PIC X(10).
03 NIP PIC X(8).
03 ST PIC X(10).
03 GOL PIC X.
03 GP PIC X(10).
01 SELEKSI PIC X.
88 YA VALUE "Y", "y".
88 TIDAK VALUE "T", "t".
77 PIL PIC X.
77 N PIC 99.
77 I PIC 99.
77 II PIC ZZ.
01 JUDUL.
02 FILLER PIC X(20) VALUE SPACE.
02 JDL PIC X(15) VALUE "DATA PEGAWAI".
01 GARIS PIC X(21) VALUE "---------------------".
01 NM-KOLOM.
02 NMR PIC X(3) VALUE "NO".
02 FILLER PIC X VALUE SPACE.
02 NAMA PIC X(15) VALUE "NAMA".
02 FILLER PIC X VALUE SPACE.
02 NP PIC X(8) VALUE "N.I.P".
02 FILLER PIC X VALUE SPACE.
02 STAT PIC X(7) VALUE "STATUS".
02 FILLER PIC X VALUE SPACE.
02 GLN PIC X(10) VALUE "GOLONGAN".
02 FILLER PIC X VALUE SPACE.
02 GPK PIC X(10) VALUE "GAJI POKOK".
02 FILLER PIC X VALUE SPACE.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
01 MENU.
02 LINE 1 COLUMN 8 VALUE " MENU PEGAWAI ".
02 LINE 2 COLUMN 7 VALUE " ------------ ".
02 LINE 3 COLUMN 7 VALUE " 1. INPUT DATA ".
02 LINE 4 COLUMN 7 VALUE " 2. TAMPIL ".
02 LINE 5 COLUMN 7 VALUE " 3. KELUAR ".
02 LINE 6 COLUMN 7 VALUE " ------------ ".
02 LINE 7 COLUMN 7 VALUE " PILIHAN ANDA : ".
02 COLUMN PLUS 2 PIC X USING PIL.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY MENU.
ACCEPT MENU.
DISPLAY CLS.
IF PIL = 1 GO TO TENTUKAN.
IF PIL = 2
COMPUTE I = 1
GO TO LAPORAN.
STOP RUN.
TENTUKAN.
DISPLAY CLS.
DISPLAY (1, 1) "JUMLAH DATA: ".
ACCEPT N.
COMPUTE I = 1.
OPEN OUTPUT COBA.
PERFORM ISI N TIMES.
CLOSE COBA.
GO TO MULAI.
ISI.
DISPLAY CLS.
DISPLAY (1, 1) "DATA KE : ", I.
DISPLAY (3, 1) " NAMA PEGAWAI : ".
ACCEPT NAPEG(I).
DISPLAY (4, 1) " NIP : ".
ACCEPT NIP(I).
DISPLAY (5, 1) " STATUS : ".
ACCEPT ST(I).
DISPLAY (6, 1) " GOL : ".
ACCEPT GOL(I).
IF GOL(I) = "A" MOVE "100000000" TO GP(I)
ELSE
IF GOL(I) = "B" MOVE "80000000" TO GP(I)
ELSE
MOVE "500000" TO GP(I).
MOVE NAPEG(I) TO NM.
MOVE ST(I) TO STA.
MOVE GP(I) TO GJ.
WRITE PEGAWAI.
COMPUTE I = I + 1.
LAPORAN.
DISPLAY CLS.
DISPLAY JUDUL.
DISPLAY GARIS, GARIS, GARIS.
DISPLAY NM-KOLOM.
DISPLAY GARIS, GARIS, GARIS.
PERFORM HASIL N TIMES.
DISPLAY GARIS, GARIS, GARIS.
DISPLAY ( , ) " KEMBALI KE MENU [Y/T] : ".
ACCEPT SELEKSI.
IF YA GO TO MULAI.
HASIL.
MOVE I TO II.
DISPLAY II, " ", NAPEG(I), " ", NIP(I), " ", ST(I), " ",
GOL(I), " ", GP(I).
COMPUTE I = I + 1
0 komentar:
Posting Komentar