- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Implementation of a table level locks in a COBOL-DB2 program during SQL execution
The locks in DB2 are acquired on table and tablespaces to avoid the issues arising due to LOST UPDATE, DIRTY READ and PHANTOM.
We need to define the lock parameter during the BIND package/plan step using the ACQUIRE option.
A COBOL-DB2 program PROGA is using SQL statements to access table TA. If we need to place a lock on the table only when that particular SQL statement is executed within the program, then we need to define the BIND JCL step as below−
//BIND EXEC PGM=IKJEFT01 //STEPLIB DD DSN=DIS.TEST.LOADLIB,DISP=SHR //SYSOUT DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(TB3) BIND PLAN(PLANA) - PKLIST(PACKA) - ACQUIRE(USE) - /*
The option ACQUIRE has to be used with the USE parameter in the BIND PLAN step. This will direct the DB2 to place the lock on the DB2 table when the SQL statement using that table is executed in the program.
- Related Articles
- Implementation of a table level locks in a COBOL-DB2 program during program execution
- Implementation of restart logic in a COBOL-DB2 program
- Behaviour of a COBOL-DB2 program when number of locks exceed the limit
- How to store a NULL value in a particular column of a DB2 table using COBOL-DB2 program?
- How can you revert all the DB2 table changes done in a COBOL-DB2 program?
- Steps involved in compilation of a COBOL-DB2 program
- How to precompile a COBOL-DB2 program?
- How to get the list of all COBOL-DB2 programs using a DB2 table TAB1?
- What is the execution result when non-SQL changes are made in a DB2 program without BIND?
- How to execute a COBOL-DB2 program PROGA of plan PLANA?
- Purpose and usage of SAVEPOINT in COBOL-DB2 program
- How NON-REPEATABLE READ & PHANTOMS impact functioning of a COBOL-DB2 program?
- Impact of database downtime on the COBOL-DB2 program
- Write the DB2 SQL query to find the third highest ORDER_TOTAL in a ORDERS DB2 table
- How can a COBOL-DB2 program call a STORED PROCEDURE? Give an example.

Advertisements