Advertisement
albertoanggi

LA - PERTEMUAN 4

Nov 1st, 2017
3,423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 1.10 KB | None | 0 0
  1.        IDENTIFICATION DIVISION.
  2.        PROGRAM-ID. TULIS.
  3.        ENVIRONMENT DIVISION.
  4.        INPUT-OUTPUT SECTION.
  5.        FILE-CONTROL.
  6.             SELECT MHS ASSIGN TO DISK
  7.             ORGANIZATION IS LINE SEQUENTIAL
  8.             FILE STATUS IS ERR.
  9.        DATA DIVISION.
  10.        FILE SECTION.
  11.        FD MHS
  12.             LABEL RECORD IS STANDARD
  13.             VALUE OF FILE-ID IS 'DATA.TXT'
  14.             DATA RECORD IS RECMHS.
  15.        01 RECMHS.
  16.             02 NAMA PIC X(25).
  17.             02 NPM PIC X(8).
  18.            
  19.        WORKING-STORAGE SECTION.
  20.        77 ERR PIC X(2).
  21.        01 ISI-LAGI PIC X.
  22.             88 LAGI VALUE 'Y', 'y'.
  23.             88 TIDAK VALUE 'T', 't'.
  24.            
  25.        SCREEN SECTION.
  26.        01 HAPUS-LAYAR.
  27.             02 BLANK SCREEN.
  28.        01 ISI-DATA.
  29.             02 LINE 3 COLUMN 5 'NAMA : ' HIGHLIGHT.
  30.             02 COLUMN PLUS 1 PIC X(25) TO NAMA.
  31.             02 LINE 4 COLUMN 5 'NPM : ' HIGHLIGHT.
  32.             02 COLUMN PLUS 1 PIC X(8) TO NPM.
  33.        PROCEDURE DIVISION.
  34.        BUKA-FILE.
  35.             OPEN OUTPUT MHS.
  36.        MULAI.
  37.             DISPLAY HAPUS-LAYAR
  38.             DISPLAY ISI-DATA
  39.             ACCEPT ISI-DATA.
  40.             WRITE RECMHS
  41.             DISPLAY(10, 5) 'ADA DATA LAGI (Y/T) ? '
  42.             ACCEPT( , ) ISI-LAGI.
  43.             IF LAGI GO TO MULAI.
  44.        SELESAI.
  45.             CLOS MHS.
  46.             STOP RUN.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement