Translate

Selasa, 15 Januari 2013

Laporan Akhir: Gaji


       IDENTIFICATION DIVISION
       PROGRAM-ID. MENU.
       AUTHOR. AYA.
       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 NAMA 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 Z(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 I1 PIC ZZ.
       01 JUDUL.
           02 FILLER PIC X(20) VALUE SPACE.
           02 JDL PIC X(15) VALUE "DATA PEGAWAI".
       01 GARIS PIC X(50) VALUE "-------------------".
       01 NM-KOLOM.
           02 NMR PIC X(3) VALUE "NO".
           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(7) 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 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) "JUMLKAH DATA : ".
           ACCEPT N.
           COMPUTE I = 1
           OPEN OUTPUT COBA.
           PERFORM ISI N TIMES.
           CLOSE COBA.
           GO TO MULAI.
       ISI.
           DISPLAY CLS.
           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 "8000000" 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 (, ) "KEMBALI KE MENU [Y/T] : ".
           ACCEPT SELEKSI.
           IF YA GO TO MULAI.
       HASIL.
           MOVE I TO I1.
           DISPLAY I1, " ", NAPEG(I), " ", NIP(I), " ", ST(I), " ",
           GOL(I), " ", GP(I).
           COMPUTE I = I + 1       IDENTIFICATION DIVISION
       PROGRAM-ID. MENU.
       AUTHOR. AYA.
       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 NAMA 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 Z(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 I1 PIC ZZ.
       01 JUDUL.
           02 FILLER PIC X(20) VALUE SPACE.
           02 JDL PIC X(15) VALUE "DATA PEGAWAI".
       01 GARIS PIC X(50) VALUE "-------------------".
       01 NM-KOLOM.
           02 NMR PIC X(3) VALUE "NO".
           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(7) 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 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) "JUMLKAH DATA : ".
           ACCEPT N.
           COMPUTE I = 1
           OPEN OUTPUT COBA.
           PERFORM ISI N TIMES.
           CLOSE COBA.
           GO TO MULAI.
       ISI.
           DISPLAY CLS.
           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 "8000000" 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 (, ) "KEMBALI KE MENU [Y/T] : ".
           ACCEPT SELEKSI.
           IF YA GO TO MULAI.
       HASIL.
           MOVE I TO I1.
           DISPLAY I1, " ", NAPEG(I), " ", NIP(I), " ", ST(I), " ",
           GOL(I), " ", GP(I).
           COMPUTE I = I + 1

Tidak ada komentar:

Posting Komentar

==================| Mohon Memberikan Komentar yang Baik :) |==================