Welcome

Gue bersyukur jika isi Blog ini bisa memberikan manfaat buat kwan2 semua ..

Sabtu, 20 November 2010

LA COBOL

IDENTIFICATION DIVISION
PROGRAM-ID. UJIAN.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT COBA ASSIGN TO DISK.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
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).
01 ULANG.
03 NAPEG PIC X(15).
03 NIP PIC X(8).
03 ST PIC X(10).
03 GOL PIC X.
03 GP PIC Z(10).
01 SELEKSI PIC X.
88 YES VALUE 'Y', 'y'.
77 PILIH PIC 9.
77 I PIC 99.
77 J PIC 99.
77 I1 PIC ZZ.
01 JUDUL.
02 JDL PIC X(15).
01 GARIS PIC X(21).
01 NAMA-KOLOM.
02 FILLER PIC X.
SCREEN SECTION.
01 CLS.
02 BLANK SCREEN.
01 MENU.
02 LINE 2 VALUE 'MENU PEGAWAI'.
02 LINE 3 VALUE '=========================='.
02 LINE 4 VALUE '1. INPUT DATA PEGAWAI'.
02 LINE 5 VALUE '2. TAMPILKAN DATA PEGAWAI'.
02 LINE 6 VALUE '3. KELUAR'.
02 LINE 7 VALUE '=========================='.
02 LINE 8 VALUE 'INPUT PILIHAN [1...3] : '.
PROCEDURE DIVISION.
MULAI.
DISPLAY CLS.
COMPUTE I = 0.
DISPLAY MENU.
ACCEPT MENU.
ACCEPT PILIH.
IF PILIH = 1
GO TO AWAL.
IF PILIH = 2
GO TO LAPORAN.
AWAL.
DISPLAY 'MASUKKAN JUMLAH DATA'.
ACCEPT J.
COMPUTE J = J - 1.
PERFORM ISI J TIMES.
ISI.
DISPLAY CLS.
COMPUTE I = I + 1.
DISPLAY (1, 1) 'DATA KE-', I.
DISPLAY (3, 1) 'NAMA PEGAWAI : '.
ACCEPT NAPEG.
DISPLAY (4, 1) 'N.I.P. : '.
ACCEPT NIP.
DISPLAY (5, 1) 'STATUS : '.
ACCEPT ST.
DISPLAY (6, 1) 'GOLONGAN : '.
ACCEPT GOL.
IF GOL = 'A' MOVE '10000000' TO GP.
IF GOL = 'B' MOVE '8000000' TO GP.
DISPLAY PEGAWAI.
MOVE '500000' TO GP.
MOVE NAPEG TO NAMA.
MOVE ST TO STA.
MOVE GP TO GJ.
DISPLAY MENU.
LAPORAN.
DISPLAY CLS.
DISPLAY JUDUL.
DISPLAY GARIS, GARIS, GARIS.
DISPLAY GARIS, GARIS, GARIS.
PERFORM HASIL.
DISPLAY GARIS, GARIS, GARIS.
DISPLAY( , ) 'INGIN KEMBALI KE MENU UTAMA [Y/T] :'.
ACCEPT SELEKSI.
IF SELEKSI = 'Y'
GO TO MULAI.
IF SELEKSI = 'T'
GO TO SELESAI.
HASIL.
MOVE I TO I1.
DISPLAY I1, ' ', NAPEG, ' ', NIP,
' ', ST, ' ', GOL, ' ', GP.
COMPUTE I = I + 1.

SELESAI.
STOP RUN.

Tidak ada komentar:

Posting Komentar