contoh file relatif
1 IDENTIFICATION DIVISION.
2 PROGRAM-ID. RELATIF.
3 AUTHOR. NAUFAN SURYA.
4 SECURITY. PROGRAM MEMASUKKAN DATA ORGANISASI FILE RELATIF
5 MODE AKSES DINAMIK.
6 ENVIRONMENT DIVISION.
7 INPUT-OUTPUT SECTION.
8 FILE CONTROL.
9 SELECT FILE-MHS ASSIGN TO DISK
10 ORGANIZATION IS RELATIVE
11 ACCESS MODE IS DYNAMIC, RELATIVE KEY IS LOKASI-REC
12 FILE STATUS IS STATUS-SALAH.
13 DATA DIVISION.
14 FILE SECTION.
15 FD FILE-MHS.
16 LABEL RECORD IS STANDARD.
17 VALUE OF FILE-ID IS ‘RELATIF.DAT’
18 DATA RECORD IS RECORD-MAHASISWA.
19 01 RECORD-MAHASISWA.
20 02 NAMA-MHS PIC A(25).
21 02 ALAMAT-MHS.
22 03 JALAN PIC X(20).
23 03 KOTA PIC A(15).
24 02 TGL-DAFTAR.
25 03 TANGGAL PIC 99.
26 03 BULAN PIC 99.
27 03 TAHUN PIC 99.
28 02 IP-MHS PIC 99V99.
29 WORKING-STORAGE SECTION.
30 77 LOKASI-REC PIC 99V99.
31 77 NO-MHS-MASUK PIC 9(5).
32 77 STATUS-SALAH PIC XX.
33 01 SUDAH-BENAR PIC X.
34 88 BENAR VALUE ‘Y’, ‘y’.
35 88 SALAH VALUE ‘T’, ‘t’.
36 01 MASUKKAN-LAGI-TIDAK PIC X.
37 88 LAGI VALUE ‘Y’, ‘y’.
38 88 TIDAK VALUE ‘T’, ‘t’.
39 01 RECORD-MAHASISWA-MASUK.
40 02 NAMA-MHS-MASUK PIC A(25).
41 02 ALAMAT-MHS-MASUK.
42 03 JALAN-MASUK PIC X(20).
43 03 KOTA-MASUK PIC A(15).
44 02 TGL-DAFTAR-MASUK.
45 03 TANGGAL-MASUK PIC 99.
46 03 BULAN-MASUK PIC 99.
47 03 TAHUN-MASUK PIC 99.
48 02 IP-MHS-MASUK PIC 99V99.
49 SCREEN SECTION.
50 01 HAPUS-LAYAR.
51 02 BLANK SCREEN.
52 01 LAYAR-DATA.
53 02 LINE 4 COLUMN 5 ‘NOMER MAHASISWA :’.
54 02 COLUMN PLUS 1 PIC 9(5) TO NO-MHS-MASUK REQUIRED.
55 02 LINE 6 COLUMN 5 ‘NAMA MAHASISWA :’.
56 02 COLUMN PLUS 1 PIC A(25) TO NAMA-MHS-MASUK.
57 02 LINE 8 COLUMN 5 ‘ALAMAT MAHASISWA :’.
58 02 LINE 9 COLUMN 5 ‘JALAN :’.
59 02 COLUMN PLUS 1 PIC X(20) TO JALAN-MASUK.
60 02 LINE 10 COLUMN 5 ‘KOTA :’.
61 02 COLUMN PLUS 1 PIC A(15) TO KOTA-MASUK.
62 02 LINE 12 COLUMN 5 ‘TANGGAL DAFTAR :’.
63 02 COLUMN PLUS 1 PIC 99 TO TANGGAL-MASUK AUTO.
64 02 COLUMN PLUS 1 ‘-’.
65 02 COLUMN PLUS 1 PIC 99 TO BULAN-MASUK AUTO.
66 02 COLUMN PLUS 1 ‘-’.
67 02 COLUMN PLUS 1 PIC 99 TO TAHUN-MASUK AUTO.
68 02 LINE 14 COLUMN 5 ‘INDEKS PRESTASI :’.
69 02 COLUMN PLUS 1 PIC 99V99 TO IP-MHS-MASUK.
70 PROCEDURE DIVISION.
71 RUTIN-UTAMA SECTION.
72 BUKA-FILE.
73 OPEN OUTPUT FILE-MHS.
74 MULAI.
75 MOVE SPACE TO SUDAH-BENAR
76 PERFORM MASUKKAN-DATA UNTIL BENAR
77 PERFORM REKAM-DATA
78 PERFORM ADA-LAGI-TIDAK.
79 SELEKSI-MASUKKAN-LAGI-TIDAK.
80 IF LAGI
81 GO TO MULAI.
82 SELESAI.
83 CLOSE FILE-MHS
84 STOP RUN.
85 RUTIN-BAGIAN SECTION.
86 MASUKKAN-DATA.
87 DISPLAY HAPUS-LAYAR
88 DISPLAY LAYAR-DATA
89 ACCEPT LAYAR-DATA.
90 DISPLAY (18, 5) ‘SUDAH BENAR (Y/T) ?’
91 ACCEPT ( , ) SUDAH-BENAR.
92 REKAM-DATA.
93 MOVE ‘ ‘ TO STATUS-SALAH
94 COMPUTE LOKASI-REC = NO-MHS-MASUK – 8009
95 WRITE RECORD-MAHASISWA FROM RECORD-MAHASISWA
96 PERFORM SELEKSI-REKAMAN.
97 ADA-LAGI-TIDAK.
98 DISPLAY (20, 5) ‘ADA LAGI DATA LAINNYA (Y/T) ?’
99 ACCEPT ( , ) MASUKKAN LAGI TIDAK.
100 SELEKSI REKAMAN.
101 IF STATUS-SALAH = ’22′
102 DISPLAY (18, 5) ‘TIDAK TEREKAM, NILAI KUNCI TIDAK UNIK’.
103 IF STATUS-SALAH = ’24′
104 DISPLAY (18, 5) ’TIDAK TEREKAM, DISK PENUH’.
0 Response to "contoh file relatif"
Post a Comment