Error/Message CPF4131 adalah Runtime Error. Hal ini biasanya terjadi karena Program RPG dan FILE tidak sinkron. Skenario kasus yang biasanya menyebabkan CPF4131 :
1. RPG A di-compile dengan kondisi FILE 1 (PF/LF).
2. Ada perubahan struktur di File 1 tersebut, lalu di-compile.
3. RPG A yang menggunakan File 1 tidak di-compile ulang.
4. Run RPG A, maka MSGW CPF4131
Pertanyaannya : “Bagaimana bisa tahu atau memastikan bahwa RPG A sudah benar menggunakan File 1 ?“
Jawab : Menggunakan command DSPPGMREF dan DSPFD
Penjelasan :
Isi dari Error CPF4131 adalah sebagai berikut :
Message ID . . . . . . . . . : CPF4131
Message file . . . . . . . . : QCPFMSG
Library . . . . . . . . . . : QSYS
Message . . . . : Level check on file &2 in library &3 with member &4.
Cause . . . . . : The file requested to be opened is file &1. The file
actually opened is file &2 in library &3. For the file actually opened, the
record format level identifiers supplied by the program does not match the
file actually opened.
Recovery . . . : Do one of the following, then try the request again:
-- Compile the program again.
-- Specify the *NO value for the LVLCHK parameter as an override using the
appropriate OVRDBF, OVRDSPF, OVRICFF, or OVRPRTF command.
Perhatikan yang di cetak tebal. Dikatakan bahwa : “Record Format Level Indentifier does not match”.
1. Cara untuk mengetahui untuk mengetahui Record Format Level Identifier pada File adalah dengan menggunakan command DSPFD <nama file>. Contoh, berikut adalah bagian informasi menggunakan DSPFD dari File T1MSTRKO :
Record Format Level
Format Fields Length Identifier
T1MSTRKR 108 1083 37DC85F1F3062
Diketahui bahwa Identifier dari T1MSTRKO adalah 37DC85F1F3062. Nilai ini tentunya berbeda-beda pada setiap file.
2. Cara untuk mengetahui Record Format Level Identifier dari setiap File yang digunakan pada program RPG adalah dengan menggunakan command DSPPGMREF <nama program>. Contoh, berikut adalah bagian informasi menggunakan DSPPGMREF dari Program DISMVALR (Program ini menggunakan File T1MSTRKO) :
Object . . . . . . . . . . . . . . . . . : T1MSTRKO
Library . . . . . . . . . . . . . . . . . : JF-(sensor :p)-D
Object type . . . . . . . . . . . . . . . : *FILE
File name in program . . . . . . . . . . : T1MSTRKO
File usage . . . . . . . . . . . . . . . : Input
Output
Update
Number of record formats . . . . . . . . : 1
Record Format Format Level Identifier Field Count
T1MSTRKR 37DC85F1F3062 108
Terlihat bahwa Identifier dari T1MSTRKO yang digunakan adalah 37DC85F1F3062. Dan ini sama dengan File Identifier pada T1MSTRKO, sehingga ketika DISMVALR di-run tidak akan memunculkan message CPF4131 untuk file T1MSTRKO. Jika Berbeda ?

Leave a comment
Comments feed for this article