20 pts.
 OPNDBF
This may sound stupid but I have not used OPNDBF command till now. I tried to use it thinking it will perform the same function as opening a database file in a COBOL program. I issued OPNDBF in a CL program and then tried to read records within a COBOL program without opening it in the COBOL program and I got the usual message wait when you try to perform operation in a database file without opening it - MCH3601. So now I am not sure in which all conditions OPBDBF is used. Can anyone give me some examples along with some code so that I can make out better how this is used. For your information, I have not even used any OVRDBF (though I had a notion that it may be required).

Software/Hardware used:
ASKED: October 20, 2005  4:49 AM
UPDATED: November 16, 2009  12:51 AM

Answer Wiki:
You'll have to do an OVRDBF with SHARE(*YES) and then the COBOL will still need the OPEN. It's just that the OPEN won't really have to do anything when it's executed. i.e., no open data path (OPD) will be created. ============================================================== The OPNDBF will create an ODP. If shared, the COBOL OPEN can use the same ODP, so a second full-open won't have to be done. Full opens are relatively expensive (performance) operations. OPNDBF can be used to create an ODP for any number of programs that will be called later in the job. That includes programs that might be called many times in a loop. OPNDBF can also be used to create an ODP that can handle all types of opens -- input only, output only or both. That means the later programs can still use the same ODP even if they're doing different kins of operations. For jobs that need to do many OPENs of particular files, setting the ODP early in the job, high in the call stack, performance can be significantly improved. Elements such as positioning in the file must be watched because a single ODP can only maintain a single position. Programs need to be sure that the next record to read or the record being updated will be the intended one. Tom
Last Wiki Answer Submitted:  November 16, 2009  12:51 am  by  TheQuigs   0 pts.
All Answer Wiki Contributors:  TheQuigs   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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