1,435 pts.
 AS400, CLLE OPENID Already Exist Error
Hi all. ! OPNID(M1AMC00) for file M1AMC00 already exists. CPF4174 received by procedure NONCLP. (C D I R). I'm getting this kind of error: what will be the solution? Surey

Software/Hardware used:
ASKED: December 27, 2012  6:00 AM
UPDATED: December 27, 2012  2:14 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. Michael Tidmarsh   11,380 pts. , Sureyz   1,435 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

DCL VAR(&TXT) TYPE(*CHAR) LEN(100)
CHGVAR VAR(&TXT) VALUE(‘DEP’ *GT ‘ *CAT ’01′)

OVRDBF FILE(M1AMC00) SHARE(*YES) SEQONLY(*NO)

OPNQRYF FILE((*LIBL/M1AMC00)) OPTION(*ALL) +
QRYSLT(&TXT) KEYFLD(*FILE) SEQONLY(*NO)

CALL PGM(NONRPG)

DLTOVR FILE(M1AMC00)
CLOF OPNID(M1AMC00)

this is my code i have already closed the file using CLOF .. but still im getting the same error.

 1,435 pts.

 

Before anything else, try calling the program in a new session. Either start a second session and test the program or sign off, sign back on and test the program. If you get the error in a new session, check the joblog for any previous errors related to the file. Post results back here. — Tom

 107,695 pts.

 

I just called the same program in different session, now its working fine ..
thanks

But what was the problem Mr.Tom ?

Surey

 1,435 pts.

 

One large possibility is that you called the program earlier in the same job, and there was an error that caused an exit early from the program. If you call the program again, the file could still be open in the job with the same open ID. You should ensure that the file is closed with error handling code when errors happen. Try running CLOF OPNID(M1AMC00) from a command line in the job that has the error. — Tom

 107,695 pts.