albertoanggi

COBOL - APA?

Nov 23rd, 2017
678
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.        IDENTIFICATION DIVISION.
  2.        PROGRAM-ID. CETAK-DATA.
  3.        ENVIRONMENT DIVISION.
  4.        INPUT-OUTPUT SECTION.
  5.        FILE-CONTROL.
  6.            SELECT MAHASISWA ASSIGN TO DISK
  7.            ORGANIZATION IS SEQUENTIAL
  8.            ACCESS MODE IS SEQUENTIAL.
  9.            SELECT CETAK ASSIGN TO PRINTER.
  10.        DATA DIVISION.
  11.        FILE SECTION.
  12.        FD MAHASISWA
  13.            LABEL RECORD IS STANDARD
  14.            VALUE OF FILE-ID IS ‘MHS.DAT’
  15.            DATA RECORD IS REC-PEG.
  16.  
  17.        01 REC-PEG.
  18.            02 NAMA PIC X(10).
  19.            02 NPM PIC X(20).
  20.            02 KELAS PIC 99.
  21.  
  22.        FD CETAK
  23.            LABEL RECORD IS OMITTED
  24.            DATA RECORD IS BARIS-CETAK.
  25.  
  26.        01 BARIS-CETAK PIC X(80).
  27.        WORKING-STORAGE SECTION.
  28.        01 JUDUL-1.
  29.            02 F PIC X(18) VALUE SPACES.
  30.            02 F PIC X(15) VALUE ‘ABSEN MAHASISWA’
  31.        01 JUDUL-2.
  32.            02 NAMA PIC X(10).
  33.            02 NPM PIC X(20).
  34.            02 KELAS PIC 99.
  35.  
  36.        01 GARIS.
  37.           02 F PIC X(70) VALUE ALL ‘-‘.
  38.  
  39.        01 DATA-PEG-O.
  40.           02 NAMA-O PIC X(10).
  41.           02 NPM-O PIC X(20).
  42.           02 KELAS-O PIC 99.
  43.        PROCEDURE DIVISION.
  44.        BUKA-FILE.
  45.            OPEN INPUT MAHASISWA
  46.            OUTPUT CETAK.
  47.        MULAI.
  48.            PERFORM CETAK-JUDUL
  49.            PERFORM CETAK-ISI-TABEL
  50.            PERFORM CETAK-GARIS.
  51.        SELESAI.
  52.            CLOSE MAHASISWA, CETAK
  53.            STOP RUN.
  54.            CETAK-JUDUL.
  55.        WRITE BARIS-CETAK FROM JUDUL-1.
  56.            02 NAMA PIC X(10).
  57.            02 NPM PIC X(20).
  58.            02 KELAS PIC 99.
  59.        CETAK-ISI-TABEL.
  60.            READ MAHASISWA AT END GO TO SELESAI.
  61.            MOVE NMS TO NAMA-O
  62.            MOVE NPMS TO NPM -O
  63.            MOVE KLS TO KELAS-O
  64.            WRITE BARIS-CETAK FROM DATA-MHS-O.
  65.        CETAK-GARIS.
  66.            WRITE BARIS-CETAK FROM GARIS.
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×