Restart Logic in COBOL DB2 Program: Restarting a program when it has abended after processing some number of records becomes necessary many times as it would be waste of resources to process them again. Rolling back the processed records is also a headache if there is no logic to start the program from the next
DB2 stored procedures mainframe–> Stored procedures are the programs that contains one or more SQL statements to perform a business functionality and can be called by any application with SQL call statements. These are ALSO considered as the programs that are compiled and stored in a DB2 server which can be called/INVOKED from any application
Scrollable cursors are introduced to overcome the limitation of reading the result table in sequential order.In Normal cursors, the cursor places at the first row of the result set when OPEN cursor statement is executed. And for each Fetch, the cursor gets moved by 1 row forward in the result table and this is the
Handling Null Values in COBOL DB2 program is an important aspect without which program may get into erroneous status. Null is nothing but no value has been populated or Value is missing for that DB2 table column.In other words, few columns gets populated only based on certain criteria, if it meets that criteria then it
Mainframes Common SQL/DB2 CODES and resolution 180 to 189 date related 180 –> Invalid date format. 203 –> reference column is ambiguous.. IT NEEDS TO BE QUALIFIED AS IT EXISTS IN MULTIPLE TABLES. This Comes when same column name exists in multiple tables (or same table is being used multiple times in same SQL) which
Joins and Unions in db2 Unions and Joins, both are used to retrieve the data from multiple tables but are served for different purposes. JOIN – Joins typically used where the data required to select are spread across multiple tables that are dependent on each other. For Example EMPLOYEE and DEPT are two tables.Here Employee
Indexes are the data base objects which are stored physically on Disk, it contains the address of the actual data stored in tables that helps to retrieve the data quickly from the database. This can be considered as the ordered set of pointers which points to the data in actual table. These are created on
SQLDA USE in Dynamic SQL: Db2 uses the SQL Descriptor Area(SQLDA) to communicate the dynamic SQL information to the application program. It contains the various information like type of SQL, length, pointer to the actual data & number of columns etc. which are very useful for better coding. To get this information into SQLDA after
How to code Dynamic SQL(DS) in a COBOL DB2 Program Dynamic SQL is prepared and executed at the run time as opposed to embedding it in the host language program as in a static one. Using dynamic SQL in the application programs has proved many advantages. For ex: In some cases the businesses requirement demands
The DB2 optimizer is the main component of DB2. As its name implies, it analyzes the SQL statements and determines the most efficient path to access the desired data from the tables. When the SQl statement is fired, it access the statistics stored in the DB2 catalog to determine the best path to suffice the