Inilah codinganya untuk membuat password pada cobol :
IDENTIFICATION DIVISION.
PROGRAM-ID.BARANG.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE-DATA ASSIGN TO DISK.
DATA DIVISION.
FILE SECTION.
FD FILE-DATA
LABEL RECORD IS STANDARD
VALUE OF FILE-ID IS 'DATA.DAT'
DATA RECORD IS RECORD-BRG.
01 RECORD-BRG.
02 KODE-PEG PIC X(5).
02 NAMA PIC X(5).
02 KOTA PIC X(5).
02 TLP PIC 9(12).
02 HARGA-BARANG PIC X(6).
77 PASWORD PIC X(10).
02 TGL PIC XX/XX/XXXX
WORKING-STORAGE SECTION.
01 BENAR-SALAH PIC X VALUE SPACE.
88 BENAR VALUE 'Y','y'.
88 SALAH VALUE 'T','t'.
01 LAGI-SUDAH PIC X VALUE SPACE.
88 LAGI VALUE 'Y','y'.
88 SUDAH VALUE 'T','t'.
SCREEN SECTION.
01 LAYAR-BETUL-SALAH.
05 LINE 20 COLUMN 10 VALUE 'SUDAH BENAR (Y/T)?'.
05 COLUMN PLUS 1 PIC X USING BENAR-SALAH.
01 LAYAR-LAGI-SUDAH.
05 LINE 23 COLUMN 10 VALUE 'ADA LAGI (Y/T) ?'.
05 COLUMN PLUS 1 PIC X USING LAGI-SUDAH.
01 LAYAR-AWAL.
05 BLANK SCREEN.
05 LINE 8 COLUMN 10 VALUE ' ENTER PASWORD : '.
05 COLUMN PLUS 1 PIC X(5) TO PASWORD SECURE.
01 LAYAR-MENAMBAH.
05 BLANK SCREEN.
05 LINE 4 COLUMN 10 VALUE 'NO PEGAWAI :'.
05 COLUMN PLUS 1 PIC X(8) TO KODE-PEG FULL,REQUIRED.
05 LINE 6 COLUMN 10 VALUE 'NAMA :'.
05 COLUMN PLUS 1 PIC X(15) TO NAMA REQUIRED.
05 LINE 8 COLUMN 10 VALUE 'ALAMAT :'.
05 COLUMN PLUS 1 PIC X(6) TO NAMA REQUIRED.
05 LINE 10 COLUMN 10 VALUE 'JENIS KELAMIN :'.
05 COLUMN PLUS 1 PIC X(9) TO KOTA REWUIRED.
05 LINE 12 COLUMN 10 VALUE 'KOTA :'.
05 COLUMN PLUS 1 PIC X(7) TO KOTA REQUIRED.
05 LINE 14 COLUMN 10 VALUE 'PENGHASILAN :'.
05 COLUMN PLUS 1 PIC 9999999 TO TLP.
05 LINE 16 COLUMN 10 VALUE 'NO TLP :'.
05 COLUMN PLUS 1 PIC 99999999 TO TLP.
05 LINE 18 COLUMN 10 VALUE 'TGL LAHIR :'.
05 COLUMN PLUS 1 PIC XX/XX/XXXX TO TGL.
PROCEDURE DIVISION.
BUKA-FILE.
OPEN OUTPUT FILE-DATA.
TAMBAH-BARU.
IF PASWORD = ‘AGUNG’
GOTO....
DISPLAY LAYAR-AWAL.
ACCEPT LAYAR-AWAL.
DISPLAY LAYAR-MENAMBAH.
ACCEPT LAYAR-MENAMBAH.
DISPLAY LAYAR-BETUL-SALAH.
ACCEPT LAYAR-BETUL-SALAH.
IF SALAH
GO TO TAMBAH-BARU.
WRITE RECORD-BRG.
DISPLAY LAYAR-LAGI-SUDAH.
ACCEPT LAYAR-LAGI-SUDAH.
IF LAGI
GO TO TAMBAH-BARU.
CLOSE FILE-DATAA.
STOP RUN
Tidak ada komentar:
Posting Komentar