Program Menu
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST.
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 "AA.DAT"
DATA RECORD IS PEGAWAI.
01 pegawai.
02 NAMA PIC X(15).
02 NPM PIC X(8).
02 STA PIC X(10).
02 GLO PIC X.
02 GJ PIC X(10).
WORKING-STORAGE SECTION.
77 PIL PIC 9.
77 N PIC 99.
77 I PIC 99.
77 I1 PIC ZZ.
01 ULANG.
02 DATA1 OCCURS 99 times.
03 NAPEG PIC X(15).
03 NIP PIC X(8).
03 ST PIC X(10).
03 GOL PIC X(10).
03 GP PIC X(10).
01 seleksi pic x.
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(2) VALUE "NO".
02 FILLER PIC X VALUE SPACES.
02 NMA PIC X(15) VALUE "NAMA".
02 FILLER PIC X VALUE SPACES.
02 NP PIC X(8) VALUE 'N.I.P'.
02 FILLER PIC X VALUE SPACES.
02 stat PIC X(10) VALUE 'STATUS'.
02 FILLER PIC X VALUE SPACES.
02 GLN PIC X(10) VALUE 'GOLONGAN'.
02 FILLER PIC X VALUE SPACES.
02 GPK PIC X(10) VALUE 'GAJI POKOK'.
02 FILLER PIC X VALUE SPACES.
SCREEN SECTION.
01 LAYAR.
02 LINE 3 COLUMN 10 "-------- MENU --------".
02 LINE 5 COLUMN 10 "1. INPUT DATA".
02 LINE 6 COLUMN 10 "2. TAMPIL".
02 LINE 7 COLUMN 10 "3. KELUAR".
02 LINE 9 COLUMN 10 "----------------------".
02 LINE 10 COLUMN 10 "PILIHAN ANDA : ".
02 COLUMN PLUS 2 PIC 9 to PIL.
01 CLS.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
DISPLAY LAYAR.
ACCEPT pil.
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 NAMA.
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 (, ) 'KEMABALI KE MENU [Y/T] : '.
ACCEPT SELEKSI.
IF seleksi = "Y" or seleksi = "y" GO TO MULAI.
HASIL.
MOVE i TO I1.
display i1 , " " , NAPEG(I) , " " , NIP(I) , " " , ST(i) , " ",
GOL(I) , " " , GP(I).
COMPUTE I = I + 1.
Notepad :
Output :
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar