- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to precompile a COBOL-DB2 program?
Precompilation is the process through which the SQL statements used in the COBOL-DB2 program are replaced by appropriate COBOL calls. The precompilation is necessary before the actual compilation because the COBOL compiler cannot recognize the DB2 SQL statements and will throw errors due to them.
DB2 utility DSNHPC is used for the precompilation. The inputs to the precompilation JCL step are DCLGEN (in SYSLIB) for the respective tables which are used in COBOL-DB2 program and COBOL-DB2 source program (in SYSIN).
//STEP010 EXEC PGM=IKJEFT01 //SYSIN DD DSN=DIS.TEST.COBOL(PSNEW2),DISP=SHR //SYSLIB DD DSN=DIS.TEST.DCLGEN(PSDC2), DISP=SHR //DBRMLIB DD DSN=DIS.TEST.DBRMLIB(PSNEW2),DISP=SHR //SYSCIN DD DSN=DIS.TEST.COBL(PSCOB2), DISP=(NEW,CATLG,DEL), SPACE=(20, (90,90)) //SYSOUT DD SYSOUT=*
Once we execute this JCL step we will receive below two main elements −
DBRM is received in DBRMLIB that contains all the SQL statements which were present in the program. The DBRM is further used in the BIND step to obtain a PLAN or a PACKAGE.
The modified COBOL source program is received in SYSCIN that has all the SQL statements replaced by COBOL calls. This modified source is further compiled and link edited.
- How to execute a COBOL-DB2 program PROGA of plan PLANA?
- Steps involved in compilation of a COBOL-DB2 program
- Implementation of restart logic in a COBOL-DB2 program
- 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?
- How can a COBOL-DB2 program call a STORED PROCEDURE? Give an example.
- Purpose and usage of SAVEPOINT in COBOL-DB2 program
- Impact of database downtime on the COBOL-DB2 program
- How to get the list of all COBOL-DB2 programs using a DB2 table TAB1?
- How NON-REPEATABLE READ & PHANTOMS impact functioning of a COBOL-DB2 program?
- Implementation of a table level locks in a COBOL-DB2 program during program execution
- How to use SQLCA in a COBOL-DB2 program? What is the purpose of SQLCA?
- How LOST UPDATE and DIRTY READ impact the processing of a COBOL-DB2 program?
- What are the steps involved to use a CURSOR in any COBOL-DB2 program?
- Behaviour of a COBOL-DB2 program when number of locks exceed the limit