<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8741359738976860584</id><updated>2026-08-29T07:47:44.389-04:00</updated><title type='text'>DB2 :Programmer&#39;s Guide</title><subtitle type='html'>A complete guide to DB2 for Z/OS.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-8751493078046056118</id><published>2018-12-12T13:36:00.002-05:00</published><updated>2018-12-12T13:37:43.357-05:00</updated><title type='text'>Long time no see</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Its been a long time since i have published any new topic. I have been busy with career and some other personal issues. But i am back and planning to be more active now.&lt;br /&gt;
&lt;br /&gt;
In coming days, i will add lot of interesting topics on DB2.&lt;br /&gt;
&lt;br /&gt;
And finally one good news , along with this blog , i am planning to reach you with new interactive way.&lt;br /&gt;
&lt;br /&gt;
New You tube Channel ,yeah... this will be really interesting.&lt;br /&gt;
&lt;br /&gt;
More details Soon.....&lt;br /&gt;
&lt;br /&gt;
Share your suggestions,thoughts for this new You tube Channel in comments.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/8751493078046056118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2018/12/long-time-no-see.html#comment-form' title='24 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/8751493078046056118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/8751493078046056118'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2018/12/long-time-no-see.html' title='Long time no see'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>24</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-232874208338489335</id><published>2017-03-29T04:27:00.001-04:00</published><updated>2017-03-29T04:27:12.294-04:00</updated><title type='text'>Indexes in DB2 - Part II</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
In this post we will talk more about the types of index and in next post how indexes works.&lt;br /&gt;
&lt;br /&gt;
Theoretically speaking there can be indexes categorized in to various types but we will talk more about the types which matters most to the programmers.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Unique Index &lt;/u&gt;&amp;nbsp;&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
This is the type of index which ensures that the value in a column or set of column of table is Unique.&lt;br /&gt;
&lt;br /&gt;
So Unique Index is the way using which DB2 ensures that no identical key values are stored in table.&lt;br /&gt;
&lt;br /&gt;
So when the Unique index creation is must??&lt;br /&gt;
&lt;br /&gt;
When you create a table, say EMP_DETAILS which has all employee details, and one of the column of this table is EMP_NO (Employee Number). You , for obvious reasons, want this column to have only unique values so you define this column as PRIMARY KEY.&lt;br /&gt;
&lt;br /&gt;
The definition of this PRIMARY KEY is not complete until you define the UNIQUE INDEX on it.So you must create unique index on this PRIMARY KEY which is the only way DB2 ensures that your PRIMARY KEY will not contain any duplicate values.&lt;br /&gt;
&lt;br /&gt;
Creating Unique index is very simple just add the word UNIQUE to normal CREATE INDEX definition.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;codeblock ibm-textcolor-default ibm-padding-top-1 ibm-padding-bottom-1 ibm-background-neutral-white-40 padding-left-2 padding-right-2&quot; style=&quot;background-color: #ececec; border: 0px; color: #323232; font-family: monospace, monospace; font-size: 16px; overflow: auto; padding: 20px 40px !important; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: inline-block; font-family: monospace, monospace; font-size: inherit; margin: 0px; max-width: 100%; overflow: auto; padding: 0px; vertical-align: baseline;&quot;&gt;CREATE UNIQUE INDEX EMPINDEX
   ON EMP_DETAILS (EMP_NO);&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
So once this UNIQUE INDEX is created DB2 prevents inserting any value in this table which has existing EMP_NO.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;What if program tries to insert the existing value of EMP_NO in this table??&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;
&lt;b&gt;&lt;i&gt;The DB2 throws error and SQLCODE is -803 which is UNIQUE INDEX violation.&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;
&lt;u&gt;&lt;b&gt;Clustering Index&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/u&gt;
When you define the clustering index on the table, then this index will determine how the rows are physically stored/ordered from table in table space.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Why as a programmer i should be bothered about how the rows are physically stored in table space , you might ask?&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Well ,CLUSTERING&amp;nbsp;&lt;span style=&quot;background-color: white; color: #323232; font-family: HelvRegularIBM, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;INDEX &amp;nbsp;&lt;/span&gt;provides significant performance advantage in some operations.&lt;br /&gt;
&lt;br /&gt;
Examples :- When there are grouping/ordering operations are performed in programs, it is very beneficial to have clustering index on table.&lt;br /&gt;
&lt;br /&gt;
This is how you create CLUSTERING INDEX on table,just add the word CLUSTER at end.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;codeblock ibm-textcolor-default ibm-padding-top-1 ibm-padding-bottom-1 ibm-background-neutral-white-40 padding-left-2 padding-right-2&quot; style=&quot;background-color: #ececec; border: 0px; color: #323232; font-family: monospace, monospace; font-size: 16px; overflow: auto; padding: 20px 40px !important; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: inline-block; font-family: monospace, monospace; font-size: inherit; margin: 0px; max-width: 100%; overflow: auto; padding: 0px; vertical-align: baseline;&quot;&gt;CREATE INDEX EMPINDEX
  ON EMP_DETAILS
    (EMP_NO ASC)&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: #ececec; color: #323232; font-family: monospace, monospace; font-size: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;CLUSTER;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/232874208338489335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2017/03/indexes-in-db2-part-ii.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/232874208338489335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/232874208338489335'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2017/03/indexes-in-db2-part-ii.html' title='Indexes in DB2 - Part II'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-7303342516535688519</id><published>2016-07-13T12:02:00.000-04:00</published><updated>2016-07-13T12:02:05.097-04:00</updated><title type='text'>Indexes in DB2 - Part I</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In order to get the bottom of any topic, I always prefer&amp;nbsp;getting the answer of &amp;nbsp;three important questions. &lt;br /&gt;
&lt;br /&gt;
What is it ?&lt;br /&gt;
Why we need it?&lt;br /&gt;
What if we don&#39;t have it?&lt;br /&gt;
&lt;br /&gt;
So, today we are going to understand the topic indexes in DB2 using these questions and try to learn as much as possible.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;What is it??&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
Index is very powerful concept , which uses the pointers to actual data to more efficiently access the specific data item.&lt;br /&gt;
&lt;br /&gt;
DB2 Indexes are the DB2 objects which can be created on columns of the table to speed up the processing of SQL queries and sometimes can also help in uniquely identifying each row in a table.&lt;br /&gt;
&lt;br /&gt;
To give one very practical example of what indexes are , think of indexing in books which you often see either at the start or end of the book catalog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxm3r-Gb6bksEbmwJQXzux_hBiJ9XwSccAcFJZYsoDnVvTnleell-MOcTbDSeParDkX8Q-SuCrTPQ3DcA60RufU940DF7nyfrJus0rn0extm1DqCbmH-bdd49W-Rhx8pQjFMBu9pKvkmgY/s1600/Index.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;242&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxm3r-Gb6bksEbmwJQXzux_hBiJ9XwSccAcFJZYsoDnVvTnleell-MOcTbDSeParDkX8Q-SuCrTPQ3DcA60RufU940DF7nyfrJus0rn0extm1DqCbmH-bdd49W-Rhx8pQjFMBu9pKvkmgY/s320/Index.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Why we need it?&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
As we mentioned above, it helps in speeding up the query processing by allowing DB2 optimizer to choose most optimized path to access the data you are looking for.&lt;br /&gt;
&lt;br /&gt;
It also helps (Depending on type of index) to uniquely identify each single row in your DB2 table.&lt;br /&gt;
&lt;br /&gt;
Lets understand this using our example of books.&lt;br /&gt;
&lt;br /&gt;
Consider any book of 1000 pages and you don&#39;t want to read a whole book but a&amp;nbsp;specific information/chapter in that book. what you will do?&lt;br /&gt;
&lt;br /&gt;
Will you start looking/reading from page 1 ,each and every page/line ,until you find the information you are looking for ?&amp;nbsp; If yes, what is the problem here?&lt;br /&gt;
&lt;br /&gt;
Obviously, It will be very time consuming&amp;nbsp;to get a small piece of information in big book.&amp;nbsp;So here indexing of the books helps us , you can just look for the specific keyword in book index and that will tell you what all the pages in book have that keyword and then you just read those specific pages to find out the exact information you are looking for.&lt;br /&gt;
&lt;br /&gt;
What it did, reduces a lot of time to get to the data and speed up our process of looking information.&lt;br /&gt;
&lt;br /&gt;
DB2 indexes are same, book is DB2 table, pages in book are DB2 pages, lines are rows in a table and specific data you are looking is the value of columns of the DB2 tables.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;What if we don&#39;t have it?&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
In above example of books, imaging you don&#39;t have indexes. You get the drill, right?&lt;br /&gt;
&lt;br /&gt;
If there is a DB2 table with large amount of data in it and there are no indexes defined on any of the columns, and you fire any simple SELECT SQL query on it.&lt;br /&gt;
&lt;br /&gt;
SELECT EMP_NAME FROM EMP_TABLE&lt;br /&gt;
WHERE EMP_NO = &#39;123456&#39;&lt;br /&gt;
&lt;br /&gt;
It will start reading the each and every DB2 page sequentially until it finds the data matching to predicates in your query and it will consume lot of CPU and Elapsed time. With time comes lot of other consequence like if the query is not defined with UR(Uncommitted read) , the locks will be held on tables/pages/rows and other process/program trying to access the same table/data at around same time will have to wait and more likely the waiting process fails with TIMEOUT.&lt;br /&gt;
&lt;br /&gt;
So proper indexing is very important and there are only pros of having indexes.&lt;br /&gt;
&lt;br /&gt;
But in some rare cases there are&amp;nbsp;times&amp;nbsp;when indexing &amp;nbsp;a table is not the way to go.&lt;br /&gt;
&lt;br /&gt;
Consider a table with very less data.. may be 100 or even 1000 rows. Here query can get you the data faster when there are no indexes.&lt;br /&gt;
&lt;br /&gt;
This is because having index is two way read process, first the indexes have to be read and then the pointers/pages&amp;nbsp; mentioned by index have to be read and with table having very less rows it is rather faster to read the data sequentially than having indexes.&lt;br /&gt;
&lt;br /&gt;
So consider having indexed when there are tables with large number of rows.&lt;br /&gt;
&lt;br /&gt;
Now, in next post we will cover the answer of next set of questions like how it works??.How indexes work and what are the types of indexes etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/7303342516535688519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2016/07/indexes-in-db2-part-i.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/7303342516535688519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/7303342516535688519'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2016/07/indexes-in-db2-part-i.html' title='Indexes in DB2 - Part I'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxm3r-Gb6bksEbmwJQXzux_hBiJ9XwSccAcFJZYsoDnVvTnleell-MOcTbDSeParDkX8Q-SuCrTPQ3DcA60RufU940DF7nyfrJus0rn0extm1DqCbmH-bdd49W-Rhx8pQjFMBu9pKvkmgY/s72-c/Index.JPG" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-5244535743273787240</id><published>2016-07-11T14:33:00.003-04:00</published><updated>2018-12-12T13:01:33.429-05:00</updated><title type='text'>DB2 Image Copy</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In a Production environment, there are constant updates happening on your DB2 tables as a result of several jobs/programs functionality. These updates are nothing but the results of the execution of &amp;nbsp;Insert/Update/Delete&amp;nbsp;statement on your various DB2 tables.&lt;br /&gt;
&lt;br /&gt;
What if, I want to take a look at the data in tables before my today&#39;s batch pass ran ?? this may be for some analysis/understanding &amp;nbsp;or worse inadvertently something went &amp;nbsp;wrong and you want to recover the data back to where it was before the job ran. Is there a way?&amp;nbsp;Wouldn&#39;t&amp;nbsp;it be&amp;nbsp;nice if some one can take a back up of my DB2 tables before the batch pass run so I can always go and get it back where we started.&lt;br /&gt;
&lt;br /&gt;
Well , it&#39;s already happening the only thing is as a programmer/ developer you may not be knowing it. This is something done by using DB2 utility and&amp;nbsp;by your DataBaseAdministrator .&lt;br /&gt;
&lt;br /&gt;
This process of taking full back-ups&amp;nbsp;of your data objects is called as DB2 full image copy. It is achieved by DB2 utility COPY.&lt;br /&gt;
&lt;br /&gt;
You can make full image copies of a variety of data objects. Data objects include table spaces, table space partitions, data sets of nonpartitioned table spaces, index spaces, and index space partitions.&lt;br /&gt;
&lt;br /&gt;
The following statement specifies that the COPY utility is to make a full image copy of the&amp;nbsp;TABSPACE table space in database &lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;DATABASE.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;em&gt;COPY TABLESPACE &lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;TABSPACE.DATABASE&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;The COPY utility writes pages from the table space or index space to the output data sets.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;So, if you want to take a look at old data before pass, all you have to do is dump that image copy dataset from COPY Utility into normal DASD file on disk.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;There is also something called as incremental image copy, this as it name suggest does not take complete copy but only the records which has changed (Insert/Update/Delete) from last run .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;The information&amp;nbsp;of&amp;nbsp;this COPY Utility can be found on the DB2&amp;nbsp;catalog table SYSIBM.SYSCOPY&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;More on how JCL&#39;S for DB2 Utility looks and how it works will be covered later in DB2 utility post which I will be doing&amp;nbsp;shortly.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;span class=&quot;keyword&quot; data-hd-product=&quot;db2z10-only&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/5244535743273787240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2016/07/db2-image-copy.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/5244535743273787240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/5244535743273787240'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2016/07/db2-image-copy.html' title='DB2 Image Copy'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-1448440045055153932</id><published>2016-06-30T15:57:00.002-04:00</published><updated>2016-06-30T15:57:47.034-04:00</updated><title type='text'>DB2 System Catalog Tables</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ever wondered, when any new DB2 object is created like Table,View,Stored Procedure,DBRM etc. where all the information is stored. Is there any place where I can look up to get all the details like all the Indexes of the table, all the columns in an index, Referential integrity on the table etc..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;DB2 system catalog tables is the answer and&amp;nbsp;Good Developer/programmer should know about it.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;All the mainframe shops generally have tools to get this information.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;These tools goes by different name , most common of those and people many know is by BMC.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;BMC Change and Catalog Manager,BMC Main View for DB2 etc.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This tool will get you all this information and have easy to use User interface and navigation but this tool in background also use the information from DB2 Systems catalog table.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;So, DB2 system catalog tables is the ultimate source where all information is recorded.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As the name suggest , there are set of special tables where information get recorded automatically whenever any object is created. With proper access we can just query these tables ,like we query any other tables, and get the desired information.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;All catalog tables are qualified by schema SYSIBM. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ex SYSIBM.SYSTABLES,SYSIBM.SYSKEYS etc.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Sample query - &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SELECT * FROM SYSIBM.SYSTABLES &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;WHERE NAME = &amp;lt;Table name&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;More about it in upcoming posts.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/1448440045055153932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2016/06/db2-system-catalog-tables.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/1448440045055153932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/1448440045055153932'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2016/06/db2-system-catalog-tables.html' title='DB2 System Catalog Tables'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-4752259636043513970</id><published>2016-06-29T09:53:00.003-04:00</published><updated>2016-07-05T12:53:56.173-04:00</updated><title type='text'>Cusror in DB2 ---&gt; Part III (Multirow fetch)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: red; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;a href=&quot;http://db2guide.blogspot.com/2012/07/cusror-in-db2-part-i.html&quot;&gt;&lt;span style=&quot;color: red; font-size: small;&quot;&gt;==&amp;gt; Click Here to Read Part I &amp;lt;==&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://db2guide.blogspot.com/2013/06/cusror-in-db2-part-ii.html&quot;&gt;&lt;span style=&quot;color: red; font-family: Arial; font-size: small;&quot;&gt;==&amp;gt; Click Here to Read Part II &amp;lt;==&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;In this post ,we are going to discuss how to fetch and process multiple rows (Multirow fetch) at a time using single fetch statement in DB2 cursor.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;The multirow fetch was introduced in DB2 version 8 onwards.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Why to use it ?&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;By fetching multiple rows at once, your request can become more efficient and it can improve the performance by reducing the CPU time.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;How to use it ?&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;As we know with regular Cursor fetch statement we can fetch one row at a time, values will be fetched into host variables and processed later into the program.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Ex - &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;EXEC SQL &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FETCH&amp;nbsp; CURSOR_NAME&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IN TO :A,:B&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;END-EXEC.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Now if we want to use&amp;nbsp;Multirow Fetch feature, First of all our Cursor should be defined with something called as &quot;With Rowset positioning&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;A rowset is a group of rows that are operated on as a set. Such a cursor enables your program to retrieve more than one row using a single FETCH statement&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;strong&gt;&lt;u&gt;Define Cursor:&lt;/u&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;EXEC SQL
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DECLARE CURSOR CURSOR_NAME
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;strong&gt;WITH ROWSET POSITIONING&lt;/strong&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FOR
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;&amp;nbsp; &amp;nbsp; SELECT EMP_NAME
  FROM   EMPTABLE
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;END-EXEC.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Now with this cursor when we use fetch statement we will get multiple rows at a time which normal host variable structure will not be able to handle it as it&amp;nbsp;was designed to receive only one row at a time.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;So,&amp;nbsp; to use a multi-row fetch you must have defined the appropriate structures to receive multi-row data. This means you must defined an array of host variables into which the fetched rows can be placed. Each column fetched requires its own host variable array into which its values will be placed. If column is nullable then make sure we have separate&amp;nbsp;&amp;nbsp;host variable array defined for null indicator.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Be sure to match the array size to the rowset size. This way a single FETCH statements can be written to retrieve more than a single row from the result set.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Fetch Cursor :&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;EXEC SQL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FETCH &lt;strong&gt;ROWSET&lt;/strong&gt; FROM CURSOR_NAME&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;FOR&amp;nbsp;10 ROWS&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO :HOST-VAR-ARRAY&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: large;&quot;&gt;END-EXEC.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;So it looks exactly like normal fetch statement except the word ROWSET and FOR 10 ROWS.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;ROWSET keyword indicates that this is a cursor with Rowset positioning.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;The FOR&amp;nbsp;10 ROWS clause specifies the size of the rowset to be returned. The maximum rowset size is 32,767.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;Rowset cursors are very useful when you need to retrieve many rows or large amounts of data. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;By retrieving multiple rows with a single FETCH, multiple trips between the application and the database can be eliminated,&lt;/span&gt; thereby improving network performance.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/4752259636043513970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2016/06/cusror-in-db2-part-iii-multirow-fetch.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4752259636043513970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4752259636043513970'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2016/06/cusror-in-db2-part-iii-multirow-fetch.html' title='Cusror in DB2 ---&gt; Part III (Multirow fetch)'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-4009150494443081799</id><published>2016-06-28T14:42:00.000-04:00</published><updated>2016-06-28T16:15:09.419-04:00</updated><title type='text'>LOB Data type in DB2.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
We have various different type of data types in DB2.&amp;nbsp; For ex- SMALL INT,INT,CHAR,VARCHAR..&lt;br /&gt;
&lt;br /&gt;
These data types seems to work fine and do their job perfectly .But if you want to store large audio,video, images or any other file which has much larger size than 32kb they cant handle it.&lt;br /&gt;
&lt;br /&gt;
VARCHAR ,VARGRAPHIC,VARBINARY has the storage limit of 32 KB.&lt;br /&gt;
&lt;br /&gt;
For data objects that are larger than 32 KB, you have to use something called as&amp;nbsp;large object (LOB) data types to store these objects.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;keyword&quot;&gt;DB2 &lt;/span&gt;provides three different type of LOB data types to store these data objects as strings of up to 2 GB in size:&lt;br /&gt;
&lt;dl&gt;
&lt;dt class=&quot;dlterm&quot;&gt;Character large objects (CLOBs) :&lt;/dt&gt;
&lt;dt class=&quot;dlterm&quot;&gt;&amp;nbsp;&lt;/dt&gt;
&lt;dd&gt;Use this data type if your data is larger (or might grow larger) than the VARCHAR data type permits. It can store up to 2GB. For example, you can store information such as an employee resume, or the text of&amp;nbsp;book in a CLOB.&lt;/dd&gt;&lt;dd&gt;&amp;nbsp;&lt;/dd&gt;
&lt;dt class=&quot;dlterm&quot;&gt;Double-byte character large objects (DBCLOBs) &lt;/dt&gt;
&lt;dd&gt;&amp;nbsp;&lt;/dd&gt;&lt;dd&gt;Use the DBCLOB data type to store large amounts of DBCS data, such as documents that use a DBCS character set.&lt;/dd&gt;&lt;dd&gt;&amp;nbsp;&lt;/dd&gt;
&lt;dt class=&quot;dlterm&quot;&gt;Binary large objects (BLOBs) &lt;/dt&gt;
&lt;dd&gt;&amp;nbsp;&lt;/dd&gt;&lt;dd&gt;Use the BLOB data type to store large amounts of non character data, such as pictures, voice, and mixed media.&lt;/dd&gt;&lt;/dl&gt;
If your data does not fit entirely within a data page, you can define one or more columns as LOB columns.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Example :&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;CREATE TABLE&lt;/strong&gt; EMPLOYEE_SALARY&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (DEPTNO&amp;nbsp;&amp;nbsp; &lt;strong class=&quot;ph b&quot;&gt;CHAR&lt;/strong&gt;(3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong class=&quot;ph b&quot;&gt;NOT NULL&lt;/strong&gt;, EMP_RESUME&amp;nbsp; &lt;strong&gt;BLOB(1G)&lt;/strong&gt; )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/4009150494443081799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2016/06/lob-data-type-in-db2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4009150494443081799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4009150494443081799'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2016/06/lob-data-type-in-db2.html' title='LOB Data type in DB2.'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-4991375881920711167</id><published>2016-06-24T15:15:00.000-04:00</published><updated>2016-06-24T15:15:21.348-04:00</updated><title type='text'>DB2 SQL query in COBOL program - Bind Warning</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
When we write embedded SQL in COBOL-DB2 application program , we know that&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;It should be always within EXEC SQL END-EXEC.&lt;/li&gt;
&lt;li&gt;If we are doing a SELECT or using a Predicate with specific value&amp;nbsp;passed in variable for comparison,&amp;nbsp;that variable should always be preceded by &lt;strong&gt;:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
All the variables preceded by : called as Host Variable. &lt;br /&gt;
&lt;br /&gt;
Ex : &lt;br /&gt;
&lt;br /&gt;
EXEC SQL&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; SELECT SAMPLE_DATE INTO :WS-DATE&lt;br /&gt;
&amp;nbsp; FROM TABLE_A WHERE DAY =&amp;nbsp;:TABLE_A.DAY&lt;br /&gt;
&lt;br /&gt;
END-EXEC.&lt;br /&gt;
&lt;br /&gt;
Here :WS-DATE ,DAY OF TABLE_A&amp;nbsp;are host variable , declared somewhere in working storage section with appropriate definition.&lt;br /&gt;
&lt;br /&gt;
What would be the consequence if somehow we miss this variable to precede with :(Say TABLE_A.DAY was not preceded by : in above query)&lt;br /&gt;
&lt;br /&gt;
Will we able to compile the program ?? Bind it ?? What&amp;nbsp;error will we get , if query is getting executed.&lt;br /&gt;
&lt;br /&gt;
First of all, yes program can be compiled, and bind will be successful. But there will be a warning message in your Bind step with SQLCODE 203 and SQLSTATE 01552.&lt;br /&gt;
&lt;br /&gt;
So lesson learnt is if your bind is successful not necessary mean that all is well, carefully look&amp;nbsp;at if there is any warning provided by DB2 precompiler.If you miss it , you will be in for surprise Production/Test failure. Just here in this case if you just go ahead and move the code with Bind warning and when program runs and try to execute this query it will fail with SQLCODE -206&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/4991375881920711167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2016/06/db2-sql-query-in-cobol-program-bind.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4991375881920711167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4991375881920711167'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2016/06/db2-sql-query-in-cobol-program-bind.html' title='DB2 SQL query in COBOL program - Bind Warning'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-5749957842554485614</id><published>2015-10-20T14:32:00.000-04:00</published><updated>2015-10-20T14:32:12.302-04:00</updated><title type='text'> Declaring host variable (The One without DCLGEN.)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;

&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 12pt;&quot;&gt;
DCLGEN (Declaration generator)
is the utility/tool provided by IBM to create the Host&amp;nbsp;Language (Cobol)
compatible variable for columns in DB2 table.&lt;br /&gt;
&lt;br /&gt;
It&#39;s simple ,you just provide the table name you are using in your
program,DCLGEN will create the&amp;nbsp;equivalent Host variable for you.&lt;br /&gt;
&lt;br /&gt;
Can you, without the help of DCLGEN,create&amp;nbsp;similar structure of
host&amp;nbsp;variable manually ??&lt;br /&gt;
&lt;br /&gt;
Yes,&amp;nbsp;off-course&amp;nbsp;you can, Provided you are able to convert the data
types and length from db2 column to that of cobol Program. For Ex. CHAR(10) to
PIC X(10),SMALLINT&amp;nbsp;to PIC S9(4) COMP etc.&lt;br /&gt;
&lt;br /&gt;
Having said that, now consider the below scenario&lt;br /&gt;
&lt;br /&gt;
I have created the host&amp;nbsp;variable manually and used it in query which
is&amp;nbsp;embedded in my application Program.&lt;br /&gt;
&lt;br /&gt;
Here it goes..&lt;br /&gt;
&lt;br /&gt;
Declaration of Host variable:&lt;br /&gt;
&lt;br /&gt;
01 WS-HOST&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;05 WS-STAT-C &amp;nbsp;PIC X(1)&lt;br /&gt;
&lt;br /&gt;
Usage in Query : (ACC_STAT_C is defined as CHAR(1) NOT NULL in RCAV0300)&lt;br /&gt;
&lt;br /&gt;
SELECT ACC_STAT_C &amp;nbsp;INTO &amp;nbsp;:WS-STAT-C &amp;nbsp;&amp;nbsp;FROM RCAV0300&lt;br /&gt;
WHERE ACC_N =&#39;1234&#39;&lt;br /&gt;
&lt;br /&gt;
Now when i execute the Program (Containing above query),i am getting the below
error.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&quot;Undefined or Unusable Host Variable
WS-STAT-C&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Can anyone one tell me what is the problem here?? Why am i getting this error??&lt;br /&gt;
&lt;br /&gt;
Well i have spelled, defined and used the variable WS-STAT-C correctly in my
Program still i am getting the above mentioned error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;b&gt;&lt;u&gt;Lesson Learnt &lt;/u&gt;:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;


&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
Whenever you define the host&amp;nbsp;variable in your
program(the one without DCLGEN) ,define it at 01 Level.If you define it at any
sub-level (05,10 etc), you will&amp;nbsp;get the error at run time
as&amp;nbsp;&quot;Undefined or Unusable Host Variable&quot;, &amp;nbsp;even though you
have&amp;nbsp;spelled,defined and used the host variable&amp;nbsp;correctly in your
program.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;
Needless to say now ,above &amp;nbsp;problem can be resolved by
declaring your variable in working storage section as&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;


&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;
01 WS-STAT-C &amp;nbsp;PIC X(1).&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;


&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/5749957842554485614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2015/10/declaring-host-variable-one-without.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/5749957842554485614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/5749957842554485614'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2015/10/declaring-host-variable-one-without.html' title=' Declaring host variable (The One without DCLGEN.)'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-3779611333072975801</id><published>2015-10-15T20:45:00.001-04:00</published><updated>2015-10-15T20:45:37.125-04:00</updated><title type='text'>Where and how to check for Consistency token</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
As a DB2 programmer you know what consistency token is and why DB2 uses it . If not, those famous SQLCODE -805 OR -818 error will make you know what it is. So let&#39;s not get into that.&lt;br /&gt;
&lt;br /&gt;
The real question is&amp;nbsp;where and how&amp;nbsp;I can&amp;nbsp;view this unique token generated by DB2 so that I can verify that it is in sync or if not in sync then who is at the fault and how to rectify it.&lt;br /&gt;
&lt;br /&gt;
So After DB2 precompiler generates this unique consistency token, it will placed and available in OBJLIB,DBRMLIB and LOAD Module library and get matched against IBM DB2 catalog table SYSIBM.SYSPACKAGE at run time.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Checking Consistency token in DBRMLIB&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;/u&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj__pqUZvlL1XNF2nmqONUAzWoJYP8rSjFAIEW9e4qDCryM_jP40fU13Bl7SHjFYuBx6oxwksadZGL4xpWF2olVZvyr-2Bb_W79u1XpGhg4WhJ2Mq-G-2Xn3xIL4OE-MBkk1Hy0LZumfHaN/s1600/TOKEN.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;102&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj__pqUZvlL1XNF2nmqONUAzWoJYP8rSjFAIEW9e4qDCryM_jP40fU13Bl7SHjFYuBx6oxwksadZGL4xpWF2olVZvyr-2Bb_W79u1XpGhg4WhJ2Mq-G-2Xn3xIL4OE-MBkk1Hy0LZumfHaN/s320/TOKEN.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open DBRMLIB library, Put command &quot;HEX ON &quot;&amp;nbsp; on command line and look at the position 25 to 32 at the very first record.That&#39;s your Consistency token&amp;nbsp;,&lt;br /&gt;
&lt;br /&gt;
So here &lt;strong&gt;19C173C91588C612&lt;/strong&gt; is the hex value of your contoken.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Checking Consistency token in LOADMODULE&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;/u&gt;&lt;br /&gt;
So this token we found in DBRM lib will be present in Load module. Well , how to find it?&lt;br /&gt;
&lt;br /&gt;
Unlike ,DBRMLIB there is no specific location in Load library where this token can be found.&lt;br /&gt;
&lt;br /&gt;
So get the token we found in DBRMLIB ,&lt;strong&gt;19C173C91588C612&amp;nbsp; &lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
Now divide into half and reverse it&amp;nbsp; that is &lt;strong&gt;1588C61219C173C9.&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Now Open Load library and put command &quot;F X&#39;&lt;strong&gt;1588C61219C173C9&#39;&lt;/strong&gt;&quot;. That&#39;s how you check it here.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Checking Consistency token in SYSIBM.SYSPACKAGE.&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;/u&gt;&lt;br /&gt;
This is very straight forward simply run the below query.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;SELECT (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBSTR(HEX(A.CONTOKEN),9,8) || SUBSTR(HEX(A.CONTOKEN),1,8 ) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) AS CONTOKEN&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;FROM SYSIBM.SYSPACKAGE&amp;nbsp;A&lt;br /&gt;&amp;nbsp;WHERE NAME IN (&#39;ABCD1234&#39;)&lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
**ABCD1234 is your program name.&lt;br /&gt;
&lt;br /&gt;
Hope you got something out of this post. &lt;br /&gt;
&amp;nbsp;&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/3779611333072975801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2015/10/where-and-how-to-check-for-consistency.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/3779611333072975801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/3779611333072975801'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2015/10/where-and-how-to-check-for-consistency.html' title='Where and how to check for Consistency token'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj__pqUZvlL1XNF2nmqONUAzWoJYP8rSjFAIEW9e4qDCryM_jP40fU13Bl7SHjFYuBx6oxwksadZGL4xpWF2olVZvyr-2Bb_W79u1XpGhg4WhJ2Mq-G-2Xn3xIL4OE-MBkk1Hy0LZumfHaN/s72-c/TOKEN.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-901509175721919314</id><published>2013-06-17T13:38:00.000-04:00</published><updated>2013-06-17T13:40:38.593-04:00</updated><title type='text'>Understanding Spufi output.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Verdana, Helvetica; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;There are various ways to&amp;nbsp;execute SQL statements in a mainframe.&lt;br /&gt;You can execute them through&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Embedding them in Application program (&amp;lt;Exec sql&amp;gt; &amp;lt;end-exec&amp;gt;)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Using QMF (Query Management Facility)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Using any third party product(vendor)&amp;nbsp;available in your shop&amp;nbsp;&amp;nbsp;like BMC,WINSQL etc.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Productivity aid sample programs like DSNTIAUL, DSNTEP2 or DSNTIAD&amp;nbsp;etc&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Using SPUFI (SQL Processing Using file input)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;This post is mainly to understand the output of the query which is run through SPUFI.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;First let’s see the sample spufi output.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; DSNE617I COMMIT PERFORMED, SQLCODE IS 0   DSNE616I STATEMENT&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; EXECUTION WAS SUCCESSFUL, SQLCODE IS 0  &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;---------+---------+---------+---------+---------+---------+----&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; DSNE601I SQL STATEMENTS ASSUMED TO BE BETWEEN COLUMNS&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;1 AND 72   DSNE620I NUMBER OF SQL STATEMENTS PROCESSED IS 1 &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; DSNE621I NUMBER OF INPUT RECORDS READ IS 32 &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; DSNE622I NUMBER OF OUTPUT RECORDS WRITTEN IS 22&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;As you can see here,the SPUFI output contains&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The executed SQL statement, copied from the input data set&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The results of executing the SQL statement&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The formatted SQLCA, if an error occurs during statement execution&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The weird and&amp;nbsp;interesting&amp;nbsp;thing if you can notice here is,even though the query ran&amp;nbsp;successfully and gave the proper result&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SQLCODE&amp;nbsp;IS 100 AND NOT 0.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Why??? My query ran successfully so,I should get sqlcode 0 right??&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Well to put you in more confusion, if i run the same query through application program ( Embeded in program) , it will give SQLCODE 0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The question remains the same rather more&amp;nbsp;aggressive&amp;nbsp;now.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The answer is&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;strong&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;“For SELECT statements that are executed with SPUFI, the message&amp;nbsp;”SQLCODE IS 100″&amp;nbsp;indicates an error-free result. If the message SQLCODE IS 100 is the only result, DB2 is unable to find any rows that satisfy the condition that is specified in the statement.&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;strong&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;For all other types of SQL statements (Other than SELECT)that are executed with SPUFI, the message&amp;nbsp;”SQLCODE IS 0″&amp;nbsp;indicates an error-free result. “&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;There is still a trick to&amp;nbsp;avoid&amp;nbsp;getting SQLCODE 100 in this case and you still can get SQLCODE 0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;You have 5 rows in your table satisfying your condition , then set&amp;nbsp;the MAXIMUM ROWS TO BE FETCHED option in the SPUFI to 5 but for this you should know in advance ,the no. of rows your query would return which is not&amp;nbsp;feasible&amp;nbsp;every time.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;If you set to any value more than 5 it would give SQLCODE 100 at the end.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;Apart from this,each SPUFI message contains the following:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The SQLCODE, if the statement executes successfully.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The formatted SQLCA, if the statement executes unsuccessfully.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;What character positions of the input data set that SPUFI scanned to find SQL statements. This information helps you check the assumptions that SPUFI made about the location of line numbers (if any) in your input data set.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Some overall statistics:&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Number of SQL statements that are processed&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Number of input records that are read (from the input data set)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Number of output records that are written (to the output data set).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Other messages that you could receive from the processing of SQL statements include:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;The number of rows that DB2 processed, that either:&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Your select operation retrieved&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Your update operation modified&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Your insert operation added to a table&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Your delete operation deleted from a table&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Which columns display truncated data because the data was too wide&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/901509175721919314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2013/06/understanding-spufi-output.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/901509175721919314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/901509175721919314'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2013/06/understanding-spufi-output.html' title='Understanding Spufi output.'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-2382555907919372455</id><published>2013-06-17T13:31:00.000-04:00</published><updated>2013-06-17T13:34:40.551-04:00</updated><title type='text'>How the DB2 Application Program runs on Mainframe</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c4c4c; line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This Post is to understand in detail how your application program runs (and various&amp;nbsp;stages it goes through)&amp;nbsp;on mainframe.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;What is DB2 Application program?&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The program written in any High-Level language (In this context COBOL language) which access the data stored in DB2 database.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;IF we feed the DB2 application program written in COBOL to the Cobol Compiler&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(IGYCRCTL&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;) it can recognize only Cobol statements in application program and cannot recognize any DB2 statement hence before feeding this program directly to Cobol compiler, we want something which can recognize DB2 statement and separate the DB2 statement from the Cobol program. This can be done by feeding the application program to DB2 Pre-compiler.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ø&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;DB2 Pre-compiler&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;:&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The DB2 pre-compiler will comment out the DB2 statement in program and replace them with the CALL statement.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;﻿﻿﻿﻿﻿&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHnJZot4JFa56xG80VSG-AVBQXRu8i3oYQnTFWtrNHgKPWZSWAyPIPJN3tjGl_Mspmp8nLtZ6jc5qTorsOInUE-vDlHOt32MUFHK3IJKeol_p6Fi2d8-7W5SfdPifxH0wLis4aC7g8GEAw/s1600/DB2+Precompiler+output.jpg&quot; style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHnJZot4JFa56xG80VSG-AVBQXRu8i3oYQnTFWtrNHgKPWZSWAyPIPJN3tjGl_Mspmp8nLtZ6jc5qTorsOInUE-vDlHOt32MUFHK3IJKeol_p6Fi2d8-7W5SfdPifxH0wLis4aC7g8GEAw/s400/DB2+Precompiler+output.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial;&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This commented DB2 statement will be stored separately in different dataset&amp;nbsp;which is called as DBRM (&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;D&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ata&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;B&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ase&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;R&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;equest&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;M&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;odule).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;So this pre-compiler separates out the main program in two parts&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The modified Source code (The main program with Commented Db2 statements and corresponding&amp;nbsp; replaced&amp;nbsp; CALL statement.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The DBRM (Contains all the DB2 statement from the source program)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The same (How the DB2-Precompiler separates out the main program in two parts) can be viewed in BATCH JCL.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQpJsyuceBs2iUNxdKR50RT5xrItocCuNnOGuzAmrmpNrAAOx1XYNPi-e-th-gGm1ORmW4hHoyTHa5P4YpDI_wi0r7wiQjrxLx0_-3STz8fqUh_NgETkboR2vVwRZa_JwDPG_N8o4cULR2/s1600/Jcl+output+1.jpg&quot; style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;227&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQpJsyuceBs2iUNxdKR50RT5xrItocCuNnOGuzAmrmpNrAAOx1XYNPi-e-th-gGm1ORmW4hHoyTHa5P4YpDI_wi0r7wiQjrxLx0_-3STz8fqUh_NgETkboR2vVwRZa_JwDPG_N8o4cULR2/s400/Jcl+output+1.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; max-width: 100%; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Place the timestamp token&amp;nbsp; on DBRM and modified source code .&lt;br /&gt;This Timestamp token will then carry forward in bot parts and will be checked at the run time when these two separated parts reunite.So at the run time the matching timestamp token will indicate that we are using the same DBRM and Modified source code which get separated at pre-compile step.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The pre-compilation timestamp token placed by DB2 pre-compiler on the DBRM can be obtained by checking the value from POS 25 through POS 32 in the DBRM header, which is the first record in the DBRM member&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO8XJQ9JKpXEHtPUpkjvon1GwdXDBCptGKMvpOAcTUvAGufRQuKfhoBFbFkSAcCRm7Q9KuYN4A01bHpTKn652aCQBVWLcw5kFkMSF22ccuHKX59ngAM0UTQ1BNliUCvhFbpnihKF9kTqWW/s1600/DBRM.jpg&quot; style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO8XJQ9JKpXEHtPUpkjvon1GwdXDBCptGKMvpOAcTUvAGufRQuKfhoBFbFkSAcCRm7Q9KuYN4A01bHpTKn652aCQBVWLcw5kFkMSF22ccuHKX59ngAM0UTQ1BNliUCvhFbpnihKF9kTqWW/s400/DBRM.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; max-width: 100%; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The pre-compilation timestamp token placed by DB2 pre-compiler on the Modified source code can be found in variable SQL-TIMESTAMP-1 SQL-TIMESTAMP-2.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIPUhBYoDrVALDobsrUX_m_7LHR7v0PZ17uDMDo75Lyabt86IhX73dhuavsDBCvaBY1F5bnSVp5DU9kfF6Y96Oupf56pLhAJP5dlmqLZX7R0PC7-aAhvSwPOL-vH8yAr1nrforb8WSqTMQ/s1600/Compiler+Listing.jpg&quot; style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIPUhBYoDrVALDobsrUX_m_7LHR7v0PZ17uDMDo75Lyabt86IhX73dhuavsDBCvaBY1F5bnSVp5DU9kfF6Y96Oupf56pLhAJP5dlmqLZX7R0PC7-aAhvSwPOL-vH8yAr1nrforb8WSqTMQ/s400/Compiler+Listing.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; max-width: 100%; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL-TIMESTAMP-1 (412701320) equals 18995288 in Hex which is the same as the first 8 digits the DBRM.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL-TIMESTAMP-2 (471453846) equals 1C19D096 in Hex which is the same as the second 8 digits the DBRM.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ø&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;COBOL Compiler (IGYCRCTL)&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The modified source code out of the DB2 pre-compiler will now fed to the COBOL compiler. The compiler will check the code for syntax error and creates the OBJLIB (Object Library)&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVfAd22nbeTuC4N42i5TPZapn2F17FjEyA598cLXzVlch3UG2Q8kR46tDF3tgsPLp5qWFKuMK-RToLK306OWKQXCFj6gI5Fa7I_FowwpX8t_KarA3ROD3V_Ga75CTlEdvcsQlRXXy1R-iK/s1600/Jcl+View+2.jpg&quot; style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;253&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVfAd22nbeTuC4N42i5TPZapn2F17FjEyA598cLXzVlch3UG2Q8kR46tDF3tgsPLp5qWFKuMK-RToLK306OWKQXCFj6gI5Fa7I_FowwpX8t_KarA3ROD3V_Ga75CTlEdvcsQlRXXy1R-iK/s400/Jcl+View+2.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; max-width: 100%; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ø&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Link-Edit (IEWL)&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;IEWL is the program which link-edit the OBJLIB created in previous step by Cobol compiler to create a LOAD MODULE (The corresponding machine level code of our main DB2 Application program)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9DfY5k7ooJUFFFT3yl09R6qiQMHm55TxcRjjy_jwqqy0tRgq55InrQv1f-nYGvJ_Nx2SFP9N_yWiwrhgKx5iZceb2l_oeKaaQIhLL9cilm9unlmgihyYUf-sDdO1UZjYmhlhy0S_Er2uD/s1600/Jcl+view+3.jpg&quot; style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9DfY5k7ooJUFFFT3yl09R6qiQMHm55TxcRjjy_jwqqy0tRgq55InrQv1f-nYGvJ_Nx2SFP9N_yWiwrhgKx5iZceb2l_oeKaaQIhLL9cilm9unlmgihyYUf-sDdO1UZjYmhlhy0S_Er2uD/s400/Jcl+view+3.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; max-width: 100%; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ø&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;BIND&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The second part created out of DB2 Pre-compiler (DBRMLIB) will now get&amp;nbsp;processed.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The Bind is type of compiler to the SQL statement (DB2 statement).It will read the DB2 Statement from the DBRMLIB and check it for syntax error and create a mechanism to execute the SQL statement.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;There are two types of BIND, BIND PLAN and BIND PACKAGE.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BIND PLAN:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;This will have the one or more DBRM, Packages or the combination of DBRM and Package as an input. The BIND PLAN command will invoke the DB2 Optimizer which intern will create the PLAN containing optimized access path to execute the SQL statement inside DBRM.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_nBo5lT3XXSN6Klp5YfNwTcogyu7Agt9MtJ-L7SVDLvnhFcxJjmTT3ST1h5nRi2lHz4kN9Q9bXN-EiIZi5Dhe7fqTUpEb3iatnoT4v5Dej_9bBvpTZgxszw1T5oZHWG6X6de9ZiuXMd6A/s1600/Bind.jpg&quot; style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;203&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_nBo5lT3XXSN6Klp5YfNwTcogyu7Agt9MtJ-L7SVDLvnhFcxJjmTT3ST1h5nRi2lHz4kN9Q9bXN-EiIZi5Dhe7fqTUpEb3iatnoT4v5Dej_9bBvpTZgxszw1T5oZHWG6X6de9ZiuXMd6A/s400/Bind.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; max-width: 100%; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The PLAN created here is an executable and will execute only along with the corresponding Load module created from modified source code through Compile-Link Edit process. None of the PLAN or Load Module can be executed alone.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;BIND PACKAGE:&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This will have only single DBRM as an input. The Package created here is not executable and need to be bind to plan again in order to get executed.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The bind process also updates the Pre-compile Timestamp token placed by the DB2 Pre-compiler on DBRM header in TIMESTAMP column in SYSIBM.SYSDBRM table .PRECOMPTS column will have the regular Timestamp. The columns PRECOMPTIME and PRECOMPDATE will have time (Resolution to 100&lt;/span&gt;&lt;/span&gt;&lt;sup&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;th&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/sup&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;of a SEC.) and Date (YYMMDD).Note the remaining flags in the DBRM header will be updated in the first row of&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SYSIBM.SYSSTMT&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;(for PLAN bind) or&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SYSIBM.SYSPACKSTMT&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;(for package bind). DB2A gets the details from these tables.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ø&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;RUN PROGRAM:&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;So at the start we separated our main DB2 application program into Modified source code and DBRM which then went through two different processes to create the LOAD module and PLAN respectively. Now just before running the program we need to reunite these two and run our main DB2 application program.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;While running, the Timestamp token placed by the DB2 pre-compiler on both part (Plan (from&lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SYSIBM.SYSDBRM&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;) and Load module) will be checked.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;We will get the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQLCODE of -818&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;if the Timestamp between two doesn’t match.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFI4tIW-vEQ6gGxxzGfIr-jo1cxxdJd2rfLTrEMCOiH8OEG9824T3S_KzX2Ob1yg5_zTgNECAuY2UJIEI7iKRd5qNDuAoK-2MoGBjasPRQLDSndHPVlNIPxcEeLGgJbG3kYZFMx1fHyVLi/s1600/Run+Jcl.jpg&quot; style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;203&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFI4tIW-vEQ6gGxxzGfIr-jo1cxxdJd2rfLTrEMCOiH8OEG9824T3S_KzX2Ob1yg5_zTgNECAuY2UJIEI7iKRd5qNDuAoK-2MoGBjasPRQLDSndHPVlNIPxcEeLGgJbG3kYZFMx1fHyVLi/s400/Run+Jcl.jpg&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; max-width: 100%; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;em&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Note&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;:&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Click on the images to get bigger view&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/2382555907919372455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2013/06/how-db2-application-program-runs-on.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/2382555907919372455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/2382555907919372455'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2013/06/how-db2-application-program-runs-on.html' title='How the DB2 Application Program runs on Mainframe'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHnJZot4JFa56xG80VSG-AVBQXRu8i3oYQnTFWtrNHgKPWZSWAyPIPJN3tjGl_Mspmp8nLtZ6jc5qTorsOInUE-vDlHOt32MUFHK3IJKeol_p6Fi2d8-7W5SfdPifxH0wLis4aC7g8GEAw/s72-c/DB2+Precompiler+output.jpg" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-7238514672026919932</id><published>2013-06-15T05:12:00.002-04:00</published><updated>2016-07-05T12:51:42.427-04:00</updated><title type='text'>Cusror in DB2 ---&gt; Part II </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;http://db2guide.blogspot.com/2016/06/cusror-in-db2-part-iii-multirow-fetch.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;==&amp;gt; Click Here to Read Part III &amp;lt;==&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;In first part we discussed&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;about,
what&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;the cursor is and why we
need it.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;In this part we will discuss
about the types of&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;cursor. Yes&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;there are different types of cursor
and they work differently depending on&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;their&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;type.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;In normal or simple cursor the data
can only be&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;retrieved&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;one row at a time in forward direction
using &quot;FETCH&quot; statement.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Scrollable&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Cursor :-&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;/span&gt;&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;With Scrollable&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;cursor, you&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;can scroll forward/backward&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;through the data(Result set of select
statement) in an application program.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Ok&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;but before everything else how do you&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;distinguish&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;that the cursor defined in the program
is scrollable or not.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;The keyword &quot;SCROLL&quot; is
use to specify that the cursor defined is scrollable.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Example:&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Declare&amp;nbsp; Cursor1 (cursor
name)&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp;&amp;nbsp;SCROLL Cursor&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Ok&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;so this is how you define it.Now, how
does it work? how do you move through the data?&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Similar&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;to normal cursor, Fetch statement is
still used&amp;nbsp; but is combined with different keyword to move the fetching in
specific direction.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Example :&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;FIRST&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
:- This will fetch the first row in the result set.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;CURRENT&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;:- This will
fetch the current row from the result set.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Similarly&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;there are different keywords like
LAST,NEXT,BEFORE,AFTER,PRIOR etc.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;So for the above defined cursor ,
the fetch statement will be&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;FETCH FIRST Cursor1 INTO .....&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Fetch first statement will
position the cursor to the first row of the result set and then fetch it to the
defined host variable.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Scrollable cursor makes it easy to
scroll through the data thus saves amount of time and effort.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;There are two types of scrollable
cursor.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Yes there are again types of
scrollable cursor but it make sense to understand on what factor they
are&amp;nbsp;diffracted.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;1. Sensitive
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : With this type of scrollable cursor,the program can
access the&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data changed&amp;nbsp;/updated by the&amp;nbsp;user.So at the
time, the data&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; being fetch from the&amp;nbsp;table using the cursor if some&amp;nbsp;&amp;nbsp;other&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process&amp;nbsp;update/delete the data from table that get
reflected in&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; the result&amp;nbsp;set.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; However,
Inserts&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;will not be reflected in
the result set.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;2. Insensitive :&amp;nbsp;&amp;nbsp; This
type of&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;scrollable&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;cursor will not show any change that
are&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;made to the&amp;nbsp;data at the time&amp;nbsp;of&amp;nbsp;fetch so the underlying data will&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;not
be reflected in the result set&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;So the&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;definition&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;of cursor finally would finally look
like&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Declare Cursor1&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;(cursor name)&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
SENSITIVE SCROLL Cursor&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Thing to&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;remember:&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;-&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Though easier to use , you should
not define every cursor to be scrollable as it require more overhead to the
normal/conventional type of cursor.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;To be specific , if you do not
need to move forward /backword&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;through
the result set do not use scrollable cursor.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Until&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;now we saw that using cursor(be it any
type) we can fetch only one row at a time.We can also fetch multiple rows using
single&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;fecth&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;statement&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;in a cursor.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;How do you do it?? we will see it
in next part.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://db2guide.blogspot.com/2016/06/cusror-in-db2-part-iii-multirow-fetch.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;==&amp;gt; Click Here to Read Part III &amp;lt;==&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/7238514672026919932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2013/06/cusror-in-db2-part-ii.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/7238514672026919932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/7238514672026919932'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2013/06/cusror-in-db2-part-ii.html' title='Cusror in DB2 ---&gt; Part II '/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-2014705853647012850</id><published>2012-07-06T08:16:00.000-04:00</published><updated>2016-07-05T12:46:16.081-04:00</updated><title type='text'>Cusror in DB2 ---&gt; Part I</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 22px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://db2guide.blogspot.com/2013/06/cusror-in-db2-part-ii.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;==&amp;gt; Click Here to Read Part II &amp;lt;==&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 22px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 22px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;W&lt;/b&gt;hen we write a Sql query in an application program and if it returns more than one row (Qualifying rows are more than 1)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; line-height: 22px;&quot;&gt;then DB2 cannot handle it and throws the SQLCODE -811.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;border: 0px; line-height: 22px; margin-bottom: 15px; margin-top: 15px; padding: 0px; text-align: left; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; color: blue;&quot;&gt;What if, i have to select/update/delete more than one row from the table via application program??&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: blue; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;--&amp;gt; DB2 cursors is all what you need.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; color: blue;&quot;&gt;Cursor will process all the qualifying rows one by one sequentially.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;To have cursor in your program , you need to follow below four steps.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;1. Declare (Define) cursor&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;2. Open Cursor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;3. Fetch Cursor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;4. Close Cursor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;1. Declare(Define) Cursor:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;You declare it in Working storage section with below syntax&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Declare cursor&amp;nbsp;for&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt; Your SQL Query &amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;You can also define your cursor in Procedure division,only condition is,it must be declare before Open cursor statement.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;If you want to Update/delete the qualifying rows from the cursor then you have add the &quot;FOR UPDATE OF&quot; clause at the end of query in Declare cursor statement.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Declare cursor&amp;nbsp;for&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt; Your SQL Query &amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;i&gt;For Update of /For UPDATE (&lt;/i&gt;If not sure about the column being updated)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;For update of clause will take the lock on the rows being updated so that no one can change it before your update it.If you don&#39;t add &quot;for update of&quot; but&amp;nbsp;update the rows ...lock will not be taken and there is danger of rows being updated by other process between your select and update statement and hence result can be unpredicted.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;Declare(Define) Cursor is non executable statement.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;2.Open Cursor :&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;This is an executable statement and executes the query from declare statement.Qualifying rows will be stored in buffer and pointer will be set just before the first qualified rows.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;If there are no qualifying rows( The predicate in your query yields no rows) pointer will be set after last row.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; color: blue;&quot;&gt;3.Fetch Cursor :&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white; color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Fetch will first move the pointer to next row and then fetch that row from buffer until end of rows.Once the end of row happens SQLCODE +100 will be returned.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;4.Close Cursor:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;This will close the cursor which you have open.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;Points to remember :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;1. If you want to handle more than one row in your application program, use cursor&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;2. If multiple rows are returned by query and you didn&#39;t use cursor ,then first row will be fetched from the table and db2 will throw SQLCODE -811.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;3. If you want only one row(any) from multiple qualifying rows from your query, you can avoid using cursor in this &amp;nbsp;case. Use fetch first 1 row only&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;(Depend on your DB2 version)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;4. Cursor can either be defined in working storage section or procedure division. The condition for declaring it in procedure division is it should be defined prior to&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;open cursor statement.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;5. DB2 can process a cursor in two different ways:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;a&amp;gt; It can create the result table(all qualifying rows) during the execution of the OPEN statement.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;b&amp;gt; It can derive the result table rows as they are needed during the execution of later FETCH statements.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;If the result table is not read-only, DB2 uses the latter method. If the result table is read-only, either method could be used.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;6. All the Cursors used in program will be automatically closed at the end of program or at COMMIT AND ROLLBACK statement (if used in the program).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;If you don&#39;t want to close the cursor at COMMIT OR ROLLBACK. Define CURSOR WITH HOLD ,it&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;will not allow the cursor to be closed and keep the position of pointer.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;In next part we will discuss the different types of cursor and there use.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;arial&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://db2guide.blogspot.com/2013/06/cusror-in-db2-part-ii.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;==&amp;gt; Click Here to Read Part II &amp;lt;==&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/2014705853647012850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2012/07/cusror-in-db2-part-i.html#comment-form' title='38 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/2014705853647012850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/2014705853647012850'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2012/07/cusror-in-db2-part-i.html' title='Cusror in DB2 ---&gt; Part I'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>38</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-5042036991367054473</id><published>2011-06-30T15:54:00.000-04:00</published><updated>2011-06-30T16:00:07.561-04:00</updated><title type='text'>Checkpoint Restart in DB2 Part - II</title><content type='html'>&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;color: #7d0700; font-family: Calibri; font: normal normal bold 20px/normal &#39;Droid Sans&#39;; line-height: 22px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; position: relative;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The first part :&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://db2guide.blogspot.com/2011/04/checkpoint-restart-in-db2.html&quot; style=&quot;color: #fb1000; font: normal normal bold 20px/normal &#39;Droid Sans&#39;; text-decoration: underline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Checkpoint Restart in DB2 Part - I&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;In first part we understood what is check point restart and why we use it. We also covered the problem associated with Check point restart and&amp;nbsp;solutions&amp;nbsp;to those problems.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, in this post we will see the step by step implementation of check point restart logic.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;CHECKPOINT/RESTART Implementation:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;STEP1&lt;/u&gt;:&lt;/b&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Create the CHECKPOINT-COMMIT record in the working storage section, to store&amp;nbsp;&lt;/div&gt;&lt;div&gt;the data, which is needed for the next unit of recovery.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;STEP2&lt;/u&gt;:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;In the procedure division MAIN para:&amp;nbsp;&lt;/div&gt;&lt;div&gt;First check the restart status flag i.e. RESTART-IND of CHECKPOINT_RESTART&amp;nbsp;&lt;/div&gt;&lt;div&gt;table.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;If RESTART-IND = ‘N’ then&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;if any output file exists &amp;nbsp;open output file in OUTPUT mode&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;start the normal process&amp;nbsp;&lt;/div&gt;&lt;div&gt;end&amp;nbsp;&lt;/div&gt;&lt;div&gt;If RESTART-IND = ‘Y’ then&lt;/div&gt;&lt;div&gt;&amp;nbsp;Move the SAVE-AREA information to CHECKPOINT-COMMIT record&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;if any output file exists&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; do the FILE REPOSITION:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Open the output file in INPUT mode.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Repeatedly &amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Read the output record and INSERT it into GLOBAL temp table&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FILE_POSITION_GTT&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Until the last unit of recovery write count.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Close the output file.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Open the output file in OUTPUT mode.&amp;nbsp;&lt;/div&gt;&lt;div&gt;open a cursor for a table FILE_POSITION_GTT&lt;/div&gt;&lt;div&gt;repeatedly fetch a cursor and write the record information into the output file &amp;nbsp;&lt;/div&gt;&lt;div&gt;until end of cursor&lt;/div&gt;&lt;div&gt;close a cursor&amp;nbsp;&lt;/div&gt;&lt;div&gt;end&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; If input for the program is from cursor then skip the rows until COMMIT-KEY.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; If input for the program is from file then skip the records until COMMIT-KEY.&amp;nbsp;&lt;/div&gt;&lt;div&gt;End.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note: For more than one output files, delete GTT after repositioning each output file.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;STEP3&lt;/u&gt;&lt;/b&gt;:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Make a count for each &amp;nbsp;Insert’s/Update’s/Deletes in &amp;nbsp;RECORDS-PROCESSEDUOR variable.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;STEP4&lt;/u&gt;:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Go thro’ the logic and find out the appropriate place where COMMIT WORK can be&amp;nbsp;hosted.&amp;nbsp;There check the frequency of COMMITS:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;IF RECORDS-PROCESSED-UOR &amp;gt; COMMIT-FREQ&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; KEY (input) value of the program &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TO COMMIT-KEY &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; MOVE checkpoint-commit record length &amp;nbsp;TO SAVE-AREA-LEN&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; MOVE checkpoint-commit record &amp;nbsp; &amp;nbsp; &amp;nbsp; TO SAVE-AREA-TEXT&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Update the CHECKPOINT_RESTART table with this information&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;END-COMMIT&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;STEP5&lt;/u&gt;:&lt;/b&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Before STOP RUN statement; reset the RESTART flag of the&amp;nbsp;&lt;/div&gt;&lt;div&gt;CHECKPOINT_RESTART table.&amp;nbsp;&lt;/div&gt;&lt;div&gt;i.e. MOVE ‘N’ TO RESTART-IND&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Update the CHECKPOINT_RESTART table with the above information.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Sample COBOL code for CHECKPOINT/RESTART Logic:&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;CHECKPOINT-COMMIT RECORD DEFINITION&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp;***************************************************************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;* GLOBAL TEMPORARY TABLE CURSOR DECLARATION &amp;amp; OPEN *&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;****************************************************************&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;DECLARE FPG-FPOS CURSOR FOR&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;SELECT RECORD_NUMBER&amp;nbsp;,RECORD_DETAIL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;FROM FILE_POSITION_GTT&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;ORDER BY RECORD_NUMBER&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EXEC.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**************************************************************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** CHECK-POINT RESTART DATA DEFINITIONS &amp;nbsp;*****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**************************************************************&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;01 COMMIT-REC.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;02 FILLER &amp;nbsp;PIC X(16) VALUE &#39;REC. PROCESSED: &#39;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;02 COMMIT-KEY &amp;nbsp;PIC 9(06) VALUE 0.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;02 FILLER &amp;nbsp;PIC X(14) VALUE &#39;TOTAL COUNTS: &#39;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;02 COMMIT-COUNTS. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;03 WS-REC-READ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PIC 9(06) VALUE 0.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;03 WS-REC-REJT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PIC 9(06) VALUE 0.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;03 WS-REC-WRIT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PIC 9(06) VALUE 0.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;03 WS-RECP-READ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PIC 9(06) VALUE 0.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;03 WS-RECP-UPDT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PIC 9(06) VALUE 0.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;01 CHKPRSL-VARS.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;02 RECORDS-PROCESSED-UOR PIC S9(09) COMP VALUE +0.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**************************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** &amp;nbsp;CHECK POINT RESTART LOGIC SECTION &amp;nbsp; *****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**************************************************************&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;RESTART-CHECK.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;XXXXXX &amp;nbsp;&#39; TO PROGRAM-NAME. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;PERFORM RESTART-SELECT.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;IF RESTART-IND = &#39;Y&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp;MOVE SAVE-AREA-TEXT TO COMMIT-REC&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;If input is from cursor the skip until the commit-key&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;If input is from file then skip the records until the commit-key &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-IF.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** CHECK RESTART STATUS &amp;nbsp;*****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**************************************************&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;RESTART-SELECT.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;MOVE 0 TO RECORD-PROCESSED-UOR.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;SELECT RESTART_IND&amp;nbsp;,COMMIT_FREQ&amp;nbsp;,RUN_TYPE&amp;nbsp;,SAVE_AREA&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;INTO :RESTART-IND&amp;nbsp;,:COMMIT-FREQ&amp;nbsp;,:RUN-TYPE&amp;nbsp;,:SAVE-AREA&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;FROM CHECKPOINT_RESTART&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;WHERE PROGRAM_NAME = :PROGRAM-NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EXEC.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF RESTART-IND = &#39;Y&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;* * * * * * * * * * * * * * * * * * * * * * * * * **********&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39; ***PROGRAM - &#39; PROGRAM-NAME &#39; RESTARTED***&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;* * * * * * * * * * * * * * * * * * * * * * * * * **********&#39;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39; &#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END-IF&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; WHEN 100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PERFORM RESTART-INSERT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN OTHER &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;RESTART-SELECT &amp;nbsp;&#39; TO WS-PARA-NAME &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;CHECKPOINT_RESTART SELECT ERR&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EVALUATE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;font-weight: bold; text-decoration: underline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;/&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**************************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** INSERT THE NEW RESTART STATUS RECORD *****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**************************************************************&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;RESTART-INSERT.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;MOVE SPACES &amp;nbsp;TO CALL-TYPE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;MOVE SPACES &amp;nbsp;TO CHECKPOINT-ID.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;N&#39; &amp;nbsp;TO RESTART-IND.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;B&#39; &amp;nbsp;TO RUN-TYPE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE +500 &amp;nbsp;TO COMMIT-FREQ. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE ZEROES &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TO COMMIT-SECONDS. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE +4006 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TO SAVE-AREA-LEN. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;MOVE SPACES &amp;nbsp;TO SAVE-AREA-TEXT.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; INSERT INTO CHECKPOINT_RESTART&lt;b style=&quot;text-decoration: underline;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; (&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; PROGRAM_NAME&amp;nbsp;,CALL_TYPE&amp;nbsp;,CHECKPOINT_ID&amp;nbsp;,RESTART_IND&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;,RUN_TYPE,COMMIT_FREQ&amp;nbsp;,COMMIT_SECONDS ,COMMIT_TIME&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;,SAVE_AREA&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;)&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;VALUES&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;(&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; :PROGRAM-NAME&amp;nbsp;,:CALL-TYPE&amp;nbsp;,:CHECKPOINT-ID&amp;nbsp;,:RESTART-IND&amp;nbsp;,:RUN-TYPE&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;,:COMMIT-FREQ&amp;nbsp;&amp;nbsp;,:COMMIT-SECONDS, CURRENT TIMESTAMP&amp;nbsp;,:SAVE-AREA&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;)&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EXEC.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CONTINUE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;WHEN OTHER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOVE &#39;RESTART-INSERT &amp;nbsp;&#39; TO WS-PARA-NAME &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOVE &#39;CHECKPOINT_RESTART INSERT&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EVALUATE&lt;b style=&quot;text-decoration: underline;&quot;&gt;.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b style=&quot;text-decoration: underline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**********************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** UPDATE THE CHECKPOINT RECORD *****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**********************************************************&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;RESTART-COMMIT.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;Y&#39; TO RESTART-IND.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;UPDATE CHECKPOINT_RESTART&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;SET RESTART_IND = :RESTART-IND&amp;nbsp;,SAVE_AREA = :SAVE-AREA&amp;nbsp;,&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;COMMIT_TIME = CURRENT TIMESTAMP&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;WHERE PROGRAM_NAME = :PROGRAM-NAME&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EXEC.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;EXEC SQL COMMIT WORK END-EXEC &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CONTINUE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN OTHER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOVE &#39;RESTART-COMMIT&#39; TO &amp;nbsp;WS-PARA-NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOVE &#39;COMMIT ERROR&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END-EVALUATE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOVE 0 TO RECORD-PROCESSED-UOR&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; WHEN OTHER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; MOVE &#39;RESTART-COMMIT&#39; TO WS-PARA-NAME &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; MOVE &#39;CHECKPOINT_RESTART UPDATE ERR&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EVALUATE.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;*******************************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** RESET THE RESTART FLAG AT THE END OF PROGRAM *****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;*******************************************************************&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;RESTART-RESET.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;MOVE 0 TO RECORD-PROCESSED-UOR.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;MOVE &#39;N&#39; TO RESTART-IND.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;UPDATE CHECKPOINT_RESTART&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;SET RESTART_IND = :RESTART-IND&amp;nbsp;,COMMIT_TIME = CURRENT TIMESTAMP&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;WHERE PROGRAM_NAME = :PROGRAM-NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EXEC.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EXEC SQL COMMIT WORK END-EXEC &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; WHEN OTHER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;RESTART-RESET&#39; TO WS-PARA-NAME &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;CHECKPOINT_RESTART DELETE ERR&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EVALUATE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;/&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;*************************************************************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** OUTPUT FILE REPOSITION LOGIC SECTION &amp;nbsp;*****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;********* * *****&amp;nbsp;********************************************&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;************************************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** GLOBAL TEMPORARY TABLE CURSOR DECLARATION &amp;amp; OPEN &amp;nbsp;*****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;*************************************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;FPG-OPEN.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; OPEN FPG-FPOS&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;i&gt;END-EXEC&lt;/i&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CONTINUE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN OTHER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;FPG-OPEN&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TO WS-PARA-NAME &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;GLOBAL TEMP TABLE OPEN &amp;nbsp;ERR&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp;END-EVALUATE.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;************************************************************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;**** &amp;nbsp; GLOBAL TEMPORARY TABLE CURSOR FETCH &amp;nbsp;*****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;************************************************************&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;FPG-FETCH.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; FETCH FPG-FPOS&amp;nbsp;INTO :FPG-RECORD-NUMBER&amp;nbsp;,:FPG-RECORD-DETAIL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EXEC.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CONTINUE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; WHEN +100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE 0 TO FPG-RECORD-NUMBER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN OTHER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;FPG-FETCH &#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TO WS-PARA-NAME &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;GLOBAL TEMP TABLE FETCH ERR&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EVALUATE.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;************************************************************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** GLOBAL TEMPORARY TABLE CURSOR CLOSE &amp;nbsp;*****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;************************************************************&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;FPG-CLOSE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;CLOSE FPG-FPOS&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;i&gt;END-EXEC.&lt;/i&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE 0 TO FPG-RECORD-NUMBER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN OTHER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;FPG-FPOS-CLOSE &#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TO WS-PARA-NAME &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MOVE &#39;GLOBAL TEMP TABLE CLOSE ERR&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EVALUATE.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***********************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***** GLOBAL TEMPORARY TABLE INSERTS &amp;nbsp;*****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***********************************************************&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;FPG-INSERT.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;ADD 1 TO FPG-RECORD-NUMBER. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXEC SQL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;INSERT INTO FILE_POSITION_GTT&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; (&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; RECORD_NUMBER&amp;nbsp;,RECORD_DETAIL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp;)&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;VALUES&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;(&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp;:FPG-RECORD-NUMBER&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;,:FPG-RECORD-DETAIL&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EXEC.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EVALUATE SQLCODE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; WHEN 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CONTINUE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN OTHER &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOVE &#39;FPG-INSERT &amp;nbsp;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TO WS-PARA-NAME &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOVE &#39;GLOBAL TEMP TABL INSERT ERR&#39; TO WS-PARA-MSG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PERFORM EXCEPTION-ROUTINE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-EVALUATE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;/&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;RESTART-FILE-REPOSITION.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;OPEN INPUT outputfile-name. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;MOVE LENGTH OF output-record TO FPG-RECORD-DETAIL-LEN. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;READ output-file INTO FPG-RECORD-DETAIL-TEXT. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;PERFORM UNTIL FPG-RECORD-NUMBER &amp;gt;= output record count of last commit&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;PERFORM FPG-INSERT&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;READ output-file INTO FPG-RECORD-DETAIL-TEXT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-PERFORM.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;CLOSE output-filename&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;OPEN OUTPUT outputfile-name. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;PERFORM FPG-OPEN.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;PERFORM FPG-FETCH.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;PERFORM UNTIL FPG-RECORD-NUMBER = 0&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;WRITE outputfile-record FROM FPG-RECORD-DETAIL-TEXT&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;PERFORM FPG-FETCH&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;END-PERFORM.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;PERFORM FPG-CLOSE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;---------skip input file until the last commit------------------&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;DISPLAY &#39; &amp;nbsp;*** ALREADY &#39; COMMIT-KEY &#39; RECORDS PROCESSED ***&#39;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;DISPLAY &#39; &#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;DISPLAY &#39; &#39;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp;/&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***********************************************************&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;************** E X C E P T I O N &amp;nbsp;R O U T I N E **************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;***********************************************************&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;EXCEPTION-ROUTINE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;MOVE SQLCODE TO WS-SQL-RET-CODE. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;*************************************************&#39;. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;**** &amp;nbsp;E R R O R &amp;nbsp; M E S S A G E S &amp;nbsp;****&#39;. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;*************************************************&#39;. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;* ERROR IN PARA.....: &#39; WS-PARA-NAME. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MESSAGES.....: &#39; WS-PARA-MSG. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;*&#39;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;* SQL RETURN &amp;nbsp;CODE..: &#39; WS-SQL-RET-CODE. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #4c1130;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISPLAY &#39;*************************************************&#39;. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Output file Disposition in JCL:&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;♦ &amp;nbsp;In JCL, disposition must be given as DISP=(NEW,CATLG,CATLG) or DISP=(OLD,KEEP,KEEP)&amp;nbsp;&lt;/div&gt;&lt;div&gt;♦ &amp;nbsp;Override statement is needed for the output files if job abended:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1. &amp;nbsp;GDG with DISP=(NEW,CATLG,CATLG)&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Override stmt:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;• &amp;nbsp;Change +1 generation to 0 (current) generation&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;• &amp;nbsp;DISP=(OLD,KEEP,KEEP)&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2. &amp;nbsp;GDG with DISP=(OLD,KEEP,KEEP)&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Override stmt:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; • &amp;nbsp;Change +1 generation to 0 (current) generation&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Output file with Disposition MOD:&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;• &amp;nbsp;If output file is already existing, and program is appending records to that, then the File&amp;nbsp;re-positioning&amp;nbsp;must be handled in different way according to the requirements.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;Internal Sort:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;If any Commit-Restart program has Internal Sort, remove it and have an External Sort.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;u&gt;&lt;b&gt;POINTS TO REMEMBER&lt;/b&gt;&amp;nbsp;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;All the update programs must use COMMIT frequency&amp;nbsp;from the CHECKPOINT_RESTART table only&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Avoid – Internal Sorts&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Avoid – Mass updates (Instead, use cursor with FOR&amp;nbsp;&lt;/li&gt;
&lt;li&gt;UPDATE clause and update one record at a time)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;On-call analyst should back-up all the output files before&amp;nbsp;&lt;/li&gt;
&lt;li&gt;restart (The procedure should be documented in APCDOC)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Reports to dispatch should be sent to a flat file; send the file&amp;nbsp;&lt;/li&gt;
&lt;li&gt;to dispatch up on successful completion of the job&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Save only the working storage variables that are required&amp;nbsp;&lt;/li&gt;
&lt;li&gt;for RESTART in the CHECKPOINT_RESTART table&amp;nbsp;&lt;/li&gt;
&lt;li&gt;RESET the RESTART_IND flag at the end of the program&amp;nbsp;&lt;/li&gt;
&lt;li&gt;If COMMIT-RESTART logic is introduced in an existing&amp;nbsp;&lt;/li&gt;
&lt;li&gt;program then make relevant changes to the PROCJCL. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/5042036991367054473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/06/checkpoint-restart-in-db2-part-ii.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/5042036991367054473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/5042036991367054473'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/06/checkpoint-restart-in-db2-part-ii.html' title='Checkpoint Restart in DB2 Part - II'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-6308075136986425385</id><published>2011-04-06T01:24:00.000-04:00</published><updated>2016-07-05T13:06:14.905-04:00</updated><title type='text'>Checkpoint Restart in DB2 Part - I</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;a href=&quot;http://db2guide.blogspot.com/2011/06/checkpoint-restart-in-db2-part-ii.html&quot;&gt;&amp;gt;&amp;gt; Click here for Part II &amp;lt;&amp;lt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;Before getting into what is check point restart and how to implement it,you&amp;nbsp;need to understand when and why you should go for it.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;HERE’S THE SCENARIO: &lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;Suppose, a batch program that basically reads an input file and posts the updates/inserts/deletes to DB2 tables in the database was abended before the end of the job because of some reasons; Is it possible to tell - How many input records were processed? Were any of the updates committed to the database or can the job be started from the beginning&lt;strong&gt;?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;Assume that COMMIT logic was not coded for large batch jobs that process millions of records. If an ABEND occurs all database updates will be rolled back and the job can be resubmitted from the beginning. If an ABEND occurs near the end of the process, the rollback of all the updates is performed. Also, DB2 will maintain a large number of locks for a long period of time, reducing concurrency in the system. In fact, the program may ABEND if it tries to acquire more than the installation-defined maximum number of locks.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;This involves setting up a batch-restart control table (CHECKPOINT_RESTART in our case) to store the last input record processed and other control information. The restart control table can also be used as an &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;instrumentation table to control the execution, commit frequency, locking protocol and termination of &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;batch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;jobs.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;br /&gt;
One of the problems with restart is synchronizing DB2 tables and output files(If your program updates some output file). DB2 will rollback all work on DB2 tables to the last commit point;&lt;strong&gt; but for output files we have to delete all the records up to the last &lt;/strong&gt;&lt;strong&gt;commit point.&lt;/strong&gt; (One option to do this would be via a global temporary table, &lt;b&gt;FILE_POSITION_GTT,&lt;/b&gt; See FILE REPOSITIONING section for further details.). &lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;COMMIT Function&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
The COMMIT statement ends a unit of recovery and commits the relational database changes that were made in that unit of recovery. If relational databases are the only recoverable resources used by the application process, COMMIT also ends the unit of work. The unit of recovery in which the statement is executed is ended and a new unit of recovery is effectively started for the process. All changes made by &lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;strong&gt;ALTER, COMMENT ON, CREATE, DELETE, DROP, EXPLAIN, GRANT, INSERT, LABEL ON &lt;/strong&gt;SQL connections are ended when any of the following apply: &lt;br /&gt;
&lt;br /&gt;
► The connection is in the release pending state&lt;br /&gt;
► The connection is not in the release pending state but it is a remote connection and: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;The DISCONNECT(AUTOMATIC) bind option is in effect, or&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;The DISCONNECT (CONDITIONAL) bind option is in effect and an open WITH HOLD cursor is not associated with the connection.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;For existing connections, &lt;br /&gt;
&lt;br /&gt;
► All open cursors that were declared with the WITH HOLD option are preserved, along with any&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;SELECT statements that were prepared for those cursors.&lt;br /&gt;
&lt;br /&gt;
► All other prepared statements are destroyed unless dynamic caching is enabled.&lt;br /&gt;
&lt;br /&gt;
► If dynamic caching is enabled, then all prepared SELECT, INSERT, UPDATE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;and&amp;nbsp;DELETE &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;statements&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot;;&quot;&gt;&amp;nbsp;that are bound with KEEPDYNAMIC (YES) are kept past the commit.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&amp;nbsp;Prepared statements cannot be kept past a commit if:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;;&quot;&gt;*&lt;/span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;SQL RELEASE has been issued for that site, or&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;;&quot;&gt;* &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;Bind option DISCONNECT(AUTOMATIC) was used, or&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;;&quot;&gt;* &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: small;&quot;&gt;Bind option DISCONNECT (CONDITIONAL) was used and there are no &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;hold &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;cursors.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;strong&gt;► &lt;/strong&gt;All implicitly acquired locks are released, except for those required for the cursors that were &lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;A place to store the details (CHECKPOINT-COMMIT record) pertaining to the current execution of the program, like various counts (number of inserts/deletes/updates/selects), number of processed, processing dates, and other details which are needed in the program after a RESTART.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;A&amp;nbsp;reliable FILE RE-POSITIONING logic with minimal changes to the existing PROCJCL. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;Flexibility, to modify the commit frequency without changing the program code. &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;strong&gt;Where we can store this CHECKPOINT-COMMIT record?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;We can store the CHECKPOINT-COMMIT record, COMMIT-FREQUENCY and other relevant&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;information in a DB2 table .&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;CHECKPOINT_RESTART TABLE DESCRIPTION&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFLWcmMBoV7GtKQKNEC5CQcsr9OAMQm895mkGniWkrR9LzWwSGOoq-GVg3-87ttcULqE6J7AZe_JItEyovTGbzm81IbYzMNlxjtSpfaAIF3-MoZKYlW4mxiJwvrIeu8zOgYNUIHwcZfnmH/s1600/CHECK.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; r6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFLWcmMBoV7GtKQKNEC5CQcsr9OAMQm895mkGniWkrR9LzWwSGOoq-GVg3-87ttcULqE6J7AZe_JItEyovTGbzm81IbYzMNlxjtSpfaAIF3-MoZKYlW4mxiJwvrIeu8zOgYNUIHwcZfnmH/s640/CHECK.png&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;strong&gt;&lt;u&gt;FILE RE-POSITIONING&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
At restart, all records written to the output file since the last commit will have to be removed. To accomplish this, FILE_POSITION_GTT global temporary table is used. SQL statements that use global temporary tables can run faster because:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;• DB2 does not log changes to global temporary tables &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;• Global temporary tables do not experience lock contention &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;•&amp;nbsp;DB2 creates an instance of the temp table &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;OPEN/SELECT/INSERT/DELETE&amp;nbsp;stmts. only occur:&lt;br /&gt;
&lt;br /&gt;
•&amp;nbsp;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;An instance of a temporary table exists at the current server until one of the following actions &lt;/span&gt;occur:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot;;&quot;&gt;•&amp;nbsp;&lt;/span&gt;The remove server connection under which the instance was created terminates&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;For ROLLBACK stmt, DB2 deletes the instance of the temporary table.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For COMMIT stmt, DB2 deletes the instance of the temporary table &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;unless &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;cursor &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;accessing &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;temporary table is defined WITH HOLD and is open. &lt;br /&gt;
&amp;nbsp;•&amp;nbsp;&lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;;&quot;&gt;The application process ends. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwYTcNEyjlMo9je5hWIr7Iay9mvkXKKxhCswhBon2S_IVgtYrG3_-O3l79a6HTVKH4BauZpkYt0AFSeVr06FXTykB_2Ky5F2qXDno_kUi_g_fJG3Wnuk7K2E67KXJdCfl565wwfuZoTJB-/s1600/CHECK.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; r6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwYTcNEyjlMo9je5hWIr7Iay9mvkXKKxhCswhBon2S_IVgtYrG3_-O3l79a6HTVKH4BauZpkYt0AFSeVr06FXTykB_2Ky5F2qXDno_kUi_g_fJG3Wnuk7K2E67KXJdCfl565wwfuZoTJB-/s640/CHECK.png&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;In next part we will discuss step by step process of check point restart installation along with sample code.&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/6308075136986425385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/04/checkpoint-restart-in-db2.html#comment-form' title='28 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/6308075136986425385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/6308075136986425385'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/04/checkpoint-restart-in-db2.html' title='Checkpoint Restart in DB2 Part - I'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFLWcmMBoV7GtKQKNEC5CQcsr9OAMQm895mkGniWkrR9LzWwSGOoq-GVg3-87ttcULqE6J7AZe_JItEyovTGbzm81IbYzMNlxjtSpfaAIF3-MoZKYlW4mxiJwvrIeu8zOgYNUIHwcZfnmH/s72-c/CHECK.png" height="72" width="72"/><thr:total>28</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-6325378887179882607</id><published>2011-03-23T06:53:00.000-04:00</published><updated>2016-07-11T13:38:03.542-04:00</updated><title type='text'>Is it a PLAN? Is it a PACKAGE?  NO, It&#39;s a CONFUSION !!!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
No matter how long programmers have worked with DB2 for z/OS , they still have the&amp;nbsp;confusion&amp;nbsp;on difference between a plan and a package and what the heck is that collection anyway.&lt;br /&gt;
&lt;br /&gt;
In this post i will be specific on the PLAN/PACKAGE difference and the things related to it (Such as COLLECTION and PKLIST). If you want to know from basic and detailing of what is PLAN/PACKAGE and how it get formed and why we need it then ,&lt;a href=&quot;http://db2guide.blogspot.com/2013/06/how-db2-application-program-runs-on.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;THIS&lt;/span&gt;&lt;/a&gt; is the great place to start up with,rather i would recommend you to read it before going further with this post.&lt;br /&gt;
&lt;br /&gt;
OK so here it goes.&lt;br /&gt;
&lt;br /&gt;
The PLAN/PACKAGE&amp;nbsp;are nothing but the&amp;nbsp;container which contains the logic of how your SQL statement in the program should get executed.[Remember when we write any query in SQL, we say what we want&amp;nbsp;and&amp;nbsp;NOT how&amp;nbsp;it is to be done (We don&#39;t care how DB2 internally does it)].So PLAN/PACKAGE contains the LOGIC how it is to be done.Then this PLAN/PACKAGE is used with load module (For COBOL)&amp;nbsp;to run your application program smoothly.&lt;br /&gt;
&lt;br /&gt;
Now why two things?? PLAN and&amp;nbsp; PACKAGE , if both are the same (Contains the LOGIC for executing your SQL) and what exactly is the difference between the two.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Binding DBRM to a PLAN&lt;/u&gt;&lt;/strong&gt; : &lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The PLAN contains the (Logic of) one or DBRM OR one or more PACKAGES&amp;nbsp;OR the combination of both.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The PLAN is executable.When i say executable it means ,it can be executed with COBOL load module to run your application program.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now let&#39;s consider there are 10 programs with names A TO J. So there will be&amp;nbsp;10 DBRM ( 1 DBRM for each program).&amp;nbsp;I bind all 10 DBRM&#39;s to a PLAN (with name &#39;PLANA&#39;).Now&amp;nbsp;let&#39;s say&amp;nbsp;i got&amp;nbsp;a requirement to change one of the Program ( let&#39;s say Program &#39;B&#39;) then i NOT ONLY need to bind this DBRM again to plan PLANA but all remaining 9 DBRM too (even though they didn&#39;t went under any change) and that is the biggest disadvantage of a binding a DBRM to a PLAN.NOT only this, if in my system there are various other PLAN&#39;s which uses this DBRM (The one which corresponds to Program &#39;B&#39;) then all those&amp;nbsp;PLAN&#39;S need to rebind along with all the other existing DBRM&#39;S they may be having.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;There are various parameters called as Bind parameter are available, when you bind your DBRM to a PLAN. These Bind parameters helps in deciding various important aspects for you program such as when to acquire a lock for the particular resource in your program,when to release the lock,what qualifier to use for the objects refered in your application program,the owner of plan etc. So when you bind your all DBRM&#39;s (10 DBRM in this example) to PLAN you have only one set of combination of these bind parameters for all 10 DBRM (For example you can not set different isolation level for different Program/DBRM , it has to be same)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Binding DBRM to a PACKAGE:&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The PACKAGE contains the (Logic of) ONLY one DBRM.It&#39;s a single bound DBRM.&lt;/li&gt;
&lt;li&gt;The PACKAGE is not executable that means it can not be use with COBOL load module to run your Application program.In order to make your PACKAGE to be executed it has to bonded to PLAN again.So you bind your DBRM to PACKAGE and then in turn this PACKAGE to PLAN.I know what you&amp;nbsp;must be thinking now,why to go this way,&amp;nbsp; isn&#39;t it&amp;nbsp;better to bind DBRM to straight away to PLAN.NO IT IS NOT, i will explain you why it is so.When i say you have to bind the DBRM to PACKAGE and then this PACKAGE to PLAN again,you&amp;nbsp;need not to do it for ever package. What i mean is, let&#39;s say i have 50 PACKAGES to bind to a PLAN no need to BIND it 50 times instead just bind a single package to PLAN using PKLIST(Package List) that&#39;s it ,you are done&amp;nbsp;and remaining 49 PACKAGES will be automatically added to your plan (For this&amp;nbsp;all your 49 Packages need to be in same PKLIST what we have bonded with PLAN earlier)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Let&#39;s take the same example what we use above for PLAN. I have 10 programs A TO J with 10 DBRM. Now in case of PACKAGE , I will bind each DBRM to one PACKAGE so i will have 10 Packages then include all 10 PACKAGES to single PKLIST (Package List) bind the Package list to a PLAN.Now if one of my Program changes , then i have to rebind only the DBRM corresponding to the Program changing and NOT the remaining DBRM&#39;S/PROGRAM (Which didn&#39;t went under the change)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Regarding Bind parameter, since i can bind 10 DBRM to 10 different PACKAGES, I can have various combination of Bind parameters for all PACKAGES.(For example Isolation level of CS for 1 PACKAGE and RR to other etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Having said that, you will wonder,you have only&amp;nbsp;the advantages of binding DBRM to PACKAGE and don&#39;t have any reason to go for binding DBRM to a PLAN.&lt;br /&gt;
&lt;br /&gt;
That is the reason , IBM is going to remove this facility of binding DBRM to PLAN in DB2 V9 Onwards&lt;br /&gt;
For more detail&amp;nbsp;on the same refer &lt;a href=&quot;http://db2guide.blogspot.com/2011/02/binding-dbrm-directly-to-plan-is-not.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;HERE&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
JQEUME5S4HKU &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/6325378887179882607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/03/is-it-plan-is-it-package-no-its.html#comment-form' title='47 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/6325378887179882607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/6325378887179882607'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/03/is-it-plan-is-it-package-no-its.html' title='Is it a PLAN? Is it a PACKAGE?  NO, It&#39;s a CONFUSION !!!'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>47</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-7627644779283944621</id><published>2011-03-17T08:17:00.000-04:00</published><updated>2011-05-24T21:04:24.442-04:00</updated><title type='text'>Lock escalation in DB2.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Lock escalation as it&#39;s name suggest is nothing but escalating the lock on the object from lower level to the higher.Lock escalation is controlled by the parameter LOCKMAX of CREATE TABLESPACE and ALTER TABLESPACE.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The purpose of lock escalation is to reduce the impact of low level locks, both in terms of CPU and storage, at the possible expense of concurrency. When the number of low level locks exceeds a specified threshold, DB2 attempts to promote the high level intent locks, either IS or IX, to S or X, respectively. If this succeeds, then the low level locks are all released and no more low level locks are requested. The lock promotion request may itself fail if other processes hold incompatible locks, either low or high level, for longer than the timeout period. If the higher level lock cannot be acquired before the timeout value has been reached, then the process times out, all updates are rolled back, and all locks are released.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;LOCKMAX :&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The parameter LOCKMAX of CREATE TABLESPACE and ALTER TABLESPACE controls the maximum number of page or row locks that an application process can hold simultaneously in a single table space. In segmented table spaces, a single table can be locked. Segmented table space organization allows some tables to perform page or row locking and other tables in the same table space to perform table locking. If the number of locked pages or rows for a table exceeds the limit, a table lock is acquired for that table. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Lock escalation is controlled by the LOCKMAX option. If a process requests more than the number specified in LOCKMAX, the intent lock on the table space, partition, or table is promoted to S or X and the page or row child locks are released.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Lock escalation occurs when the number of locks held by a single process exceeds the LOCKMAX value on a table space. Lock escalation involves obtaining a table or table space lock, then releasing all of the page or row locks. Lock escalation is a safety valve that DB2 provides in case an application overuses system resources. LOCKMAX 0 means that you are disabling this useful feature. Loss of concurrency is less likely to be incurred with lock escalation if the majority of the rows or pages in a table space are already locked, as long as RELEASE(COMMIT) is used. Lock escalation in such a situation reduces storage use, but more importantly, reduces the CPU time needed to traverse a lock hash synonym chain. Lock escalation also reduces the Internal Resource Lock Manager (IRLM) latch suspension time, which also reduces CPU time.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Lock escalation for a partitioned table space will cause DB2 to promote the intent locks for every partition where child locks are currently held. Any subsequent access to a new partition will cause DB2 to request gross locks on that partition from the outset. The LOCKMAX figure applies to all locks held at the table space level when it is a multi-table table space.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The column LOCKMAX on the catalog table SYSIBM.SYSTABLESPACE stores the maximum number of locks per user on the table or table space before escalating to the next locking level. A value of -1 indicates LOCKMAX=SYSTEM. Any escalation process is suspended during the execution of SQL statements for ALTER, CREATE, DROP, GRANT, and REVOKE.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Lock escalation is an expensive process, both in terms of lock management and concurrency. In today’s high availability environment, you should design the application to allow no reason for lock escalations to occur. The benefit of lock escalation is in protecting DB2 from an excessive number of locks held in the IRLM on behalf of poorly designed applications that are not releasing their locks.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Lock escalation also prevents poorly designed applications from reaching the maximum number of locks per user specified by the NUMLKUS DSNZPARM. From an individual application perspective, this may seem like a good thing, but from an overall availability and performance standpoint, it is merely rewarding bad design. The focus should be on identifying and correcting those poorly designed applications that take an excessive number of locks.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;For critical large table spaces that are accessed by many application processes concurrently, choose the LOCKMAX value so that there will not be any lock escalation within a unit of work, if NUMLKTS DSNZPARM is not large enough.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/7627644779283944621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/03/lock-escalation-in-db2.html#comment-form' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/7627644779283944621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/7627644779283944621'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/03/lock-escalation-in-db2.html' title='Lock escalation in DB2.'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-3345888261217219149</id><published>2011-03-13T13:12:00.000-04:00</published><updated>2011-05-24T21:04:24.442-04:00</updated><title type='text'>Row Identifier in DB2 (V9 Onwards)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I use to wonder why we don&#39;t have something called as row identifier in DB2 as it is there in oracle or MySQL.Finally IBM added it in V9 and continued in V10.&lt;br /&gt;
&lt;br /&gt;
Let me explain what row identifier is and what purpose it serves.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;shortdesc&quot;&gt;The RID function returns the record ID (RID) of a row. The RID is used to uniquely identify a row.&lt;/div&gt;&lt;div class=&quot;shortdesc&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;The function might return a different value when it is invoked multiple times for a row. For example, after the REORG utility is run, the RID function might return a different value for a row than would have been returned prior to the REORG utility being run. The RID function is not deterministic.&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;DB2 might reuse RID numbers when a REORG operation is performed. If the RID function is used to obtain a value for a row and an application depends on that value remaining the same as long as the row exists, consider the following alternatives:&lt;/div&gt;&lt;ul class=&quot;ul&quot;&gt;&lt;li class=&quot;li&quot;&gt;Add a ROW ID column to the table to provide a value that can be associated with each row, rather than invoking the RID function to generate a value for a row.&lt;/li&gt;
&lt;li class=&quot;li&quot;&gt;Define a primary key for the table, using the columns of the primary key to ensure uniqueness, rather than invoking the RID function to generate a value for a row.&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;p&quot;&gt;&lt;em&gt;&lt;strong&gt;&lt;u&gt;Example&lt;/u&gt;&lt;/strong&gt; :&lt;/em&gt; Return the RID and last name of employees who are in department &#39;20&#39;: &lt;br /&gt;
&lt;pre class=&quot;pre codeblock&quot; xml:space=&quot;preserve&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;pre codeblock&quot; xml:space=&quot;preserve&quot;&gt;&lt;em&gt; SELECT RID(EMP), LASTNAME
     FROM EMP
     WHERE DEPTNO = &#39;20&#39;;&lt;/em&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;Let me give you the practical example of use of row identifier in my shop.&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;We had one table in our database&amp;nbsp;which didn&#39;t had any primary key to it and hence no facility to identify any unique row in the table (Agree, the table was badly designed by my&amp;nbsp;DBA)&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;There was one program which use to insert rows in this table, but sometimes it inserts the duplicate and we didn&#39;t had any alarm for it as there is no primary key and hence no unique index.So while fetching row from this table in the program,it used to give -811 sqlcode.So to resolve this abend we have to delete two rows(duplicate) and insert one (we can&#39;t delete only one duplicate row as we don&#39;t have anything unique to identify the row ) So here it was the RID which helped us to delete the duplicate row straight away (no need to insert two rows and then insert one).&lt;/div&gt;&lt;div class=&quot;p&quot;&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/3345888261217219149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/03/row-identifier-in-db2-v9-onwards.html#comment-form' title='60 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/3345888261217219149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/3345888261217219149'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/03/row-identifier-in-db2-v9-onwards.html' title='Row Identifier in DB2 (V9 Onwards)'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>60</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-6659453868169336351</id><published>2011-03-07T14:55:00.000-05:00</published><updated>2011-05-24T21:04:24.442-04:00</updated><title type='text'>Isolation Level in DB2.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;As i mentioned earlier, i wanted to take this concept in a separate post.Isolation level parameter is the one you specify while binding your Application program&#39;s DBRM in to Plan/Package.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The problem with Isolation level is no matter how many times you read it or from which source you read it you won&#39;t understand it.I mean you just read it but when you have to actually use it in you shop, you wonder how to use it and this is because you don&#39;t have any practical example of it .once you have any real world example of each isolation level, you most probably will remember and most importantly use wisely in your instances.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;So let&#39;s just understand each isolation level in detail with the real world example.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;First of all understand what is isolation level and why we need it??&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Several different users can access and modify data stored in a DB2 database at the same time, the DB2 Database Manager must be able to allow users to make necessary changes while ensuring that data integrity is never compromised.&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The sharing of resources by multiple interactive users or application programs at the same time is known as &lt;i class=&quot;emphasis&quot;&gt;concurrency&lt;/i&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;One of the ways DB2 enforces concurrency is through the use of &lt;i class=&quot;emphasis&quot;&gt;isolation levels&lt;/i&gt;, which determine how data accessed and/or modified by one transaction is &quot;isolated from&quot; other transactions. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;DB2 recognizes and supports the following isolation levels:&lt;/span&gt;&lt;br /&gt;
&lt;ul class=&quot;itemizedlist&quot;&gt;&lt;li class=&quot;first-listitem&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;835-2&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Repeatable Read&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RR)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;listitem&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;835-3&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Read Stability&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RS)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;listitem&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;835-4&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Cursor Stability&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (CS)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;listitem&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;835-5&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Uncommitted Read (UR)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;first-para&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The Repeatable Read Isolation Level&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The Repeatable Read isolation level is the most restrictive isolation level available.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;When it&#39;s used, the effects of one transaction are completely isolated from the effects of other concurrent transactions.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;When this isolation level is used, every row that&#39;s referenced &lt;i class=&quot;emphasis&quot;&gt;in any manner&lt;/i&gt; by the owning transaction is locked for the duration of that transaction. As a result, if the same &lt;span class=&quot;fixed&quot;&gt;SELECT&lt;/span&gt; SQL statement is issued multiple times within the same transaction, the result data sets produced are guaranteed to be identical. In fact, transactions running under this isolation level can retrieve the same set of rows any number of times and perform any number of operations on them until terminated, either by a commit or a rollback operation. However, other transactions are prohibited from performing insert, update, or delete operations that would affect any row that has been accessed by the owning transaction as long as that transaction remains active.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;para&quot; id=&quot;838-3&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;To ensure that the data being accessed by a transaction running under the Repeatable Read isolation level is not adversely affected by other transactions, each row referenced by the isolating transaction is locked—not just the rows that are actually retrieved or modified.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Thus, if a transaction scans 1,000 rows in order to retrieve 10, locks are acquired and held &lt;u&gt;on all 1,000 rows scanned—not just on the 10 rows retrieved.&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;
&lt;div class=&quot;para&quot;&gt;&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tip&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;admon-title&quot; valign=&quot;top&quot;&gt;&lt;/td&gt;&lt;td class=&quot;admon-body&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;839-1&quot;&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tip&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;admon-title&quot; valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;admon-body&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;839-1&quot;&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div class=&quot;para&quot;&gt;&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tip&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;admon-title&quot; valign=&quot;top&quot;&gt;&lt;/td&gt;&lt;td class=&quot;admon-body&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;839-1&quot;&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Real World Example&lt;/u&gt; :&lt;/em&gt;&lt;/strong&gt; So how does this isolation level work in a real-world situation? lets&#39;s see..&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Suppose you use a DB2 database to keep track of hotel records that consist of reservation and room rate information, and you have a Web-based application that allows individuals to book rooms on a first-come, first-served basis.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;If your reservation application runs&lt;em&gt; under the Repeatable Read isolation level&lt;/em&gt;, a customer scanning the database for a list of rooms available for a given date range will &lt;em&gt;prevent you (the manager) from changing&lt;/em&gt; the room rate for &lt;em&gt;any of the room records that were scanned to resolve the customer&#39;s query&lt;/em&gt;. Similarly, other customers won&#39;t be able to make or cancel reservations that would cause the first customer&#39;s list of available rooms to change if the same query were to be run again (provided the first customer&#39;s transaction remained active). However, you would be allowed to change room rates for any room record that was not read when the first customer&#39;s list was produced; likewise, other customers would be able to make or cancel room reservations for any room whose record was not read in order to produce a response to the first customer&#39;s query. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The Read Stability Isolation Level&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The Read Stability isolation level is not quite as restrictive as the Repeatable Read isolation level; therefore, it does not completely isolate one transaction from the effects of other, concurrent transactions.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;When the Read Stability isolation level is used, &lt;em&gt;only rows that are actually retrieved or modified by the owning transaction are locked.&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Thus, if a transaction scans 1,000 rows in order to retrieve 10, &lt;u&gt;locks are only acquired and held on the 10 rows retrieved, not on the 1,000 rows scanned. &lt;/u&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Because fewer locks are acquired, more transactions can run concurrently. As a result, if the same &lt;span class=&quot;fixed&quot;&gt;SELECT&lt;/span&gt; SQL statement is issued two or more times within the same transaction, the result data set produced may not be the same each time.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;As with the Repeatable Read isolation level, transactions running under the Read Stability isolation level can retrieve a set of rows and perform any number of operations on them until terminated. Other transactions are prohibited from performing update or delete operations that would affect the set of rows retrieved by the owning transaction as long as that transaction exists; however, other transactions can perform insert operations.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;em&gt;&lt;strong&gt;&lt;u&gt;Real World Example&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt; : We will take the same example and see how read stability change it.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Now, when a customer scans the database to obtain a list of rooms available for a given date range, you (the manager) will be&lt;em&gt; able to change the rate for any room that does not appear on the customer&#39;s list&lt;/em&gt;. Likewise, other customers will be able to make or cancel reservations that would cause the first customer&#39;s list of available rooms to change if the same query were to be run again. As a result, if the first customer queries the database for available rooms&lt;em&gt; for the same date range again, the list produced may contain new room rates and/or rooms that were not available the first time the list was generated.&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The Cursor Stability Isolation Level&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The Cursor Stability isolation level is even more relaxed than the Read Stability isolation level in the way it isolates one transaction from the effects of other concurrent transactions.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The cursor stability isolation level &lt;em&gt;&lt;strong&gt;only locks the row that is currently referenced by a cursor&lt;/strong&gt;&lt;/em&gt; that was declared and opened by the owning transaction. (The moment a record is retrieved from a result data set, a pointer—known as a &lt;i class=&quot;emphasis&quot;&gt;cursor&lt;/i&gt;—will be positioned on the corresponding row in the underlying table, and that row will be locked. The lock acquired will remain in effect until the cursor is repositioned—more often than not by executing the &lt;span class=&quot;fixed&quot;&gt;FETCH&lt;/span&gt; SQL statement—or until the owning transaction terminates.) And because only one row-level lock is acquired, more transactions can run concurrently.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The Cursor Stability isolation level is the isolation level used by default.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;When a transaction using the Cursor Stability isolation level retrieves a row from a table via a cursor, no other transaction is allowed to update or delete that row while the cursor is positioned on it. Other transactions, however, can add new rows &lt;/span&gt;&lt;a href=&quot;http://www.blogger.com/&quot; id=&quot;846&quot; name=&quot;846&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/&quot; id=&quot;IDX-473&quot; name=&quot;IDX-4739EA06EC3-E817-48FE-A1C0-D359093B52ED&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;to the table as well as perform update and/or delete operations on rows positioned on either side of the locked row—provided the locked row itself wasn&#39;t accessed using an index. Once acquired, the lock remains in effect until the cursor is repositioned or until the owning transaction is terminated. (If the cursor is repositioned, the lock being held is released and a new lock is acquired for the row to which the cursor is moved.) Furthermore, if the owning transaction modifies any row it retrieves, no other transaction is allowed to update or delete that row until the owning transaction is terminated, even though the cursor may no longer be positioned on the modified row.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot; id=&quot;846-1&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;As you might imagine, when the Cursor Stability isolation level is used, if the same &lt;span class=&quot;fixed&quot;&gt;SELECT&lt;/span&gt; SQL statement is issued two or more times within the same transaction, the results returned may not always be the same. In addition, transactions using the Cursor Stability isolation level will not see changes made to other rows by other transactions until those changes have been committed.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Real world example&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;: Let&#39;s reserve the hotel again by using Cursor Stability&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;When a customer scans the database for a list of rooms available for a given date range and then views information about each room on the list produced (one room at a time), you (the manager) will be able to change the room rates &lt;em&gt;for any room in the hotel except the room the customer is currently looking at&lt;/em&gt; (for the date range specified). Likewise, other customers will be able to make or cancel reservations for any room in the hotel &lt;i class=&quot;emphasis&quot;&gt;except&lt;/i&gt; the room the customer is currently looking at (for the date range specified). However, neither you nor other customers will be able to do anything with the room record the first customer is currently looking at. When the first customer views information about another room in the list, you and other customers will be able to modify the room record the first customer was just looking at (provided the customer did not reserve it for himself). Again, neither you nor other customers will be able to do anything with the room record at which the first customer is currently looking. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The Uncommitted Read Isolation Level&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The Uncommitted Read isolation level is the least restrictive isolation level available. In fact, when the Uncommitted Read isolation level is used, rows retrieved by a transaction are &lt;em&gt;only locked if the transaction modifies data associated with one or more rows retrieved or if another transaction attempts to drop or alter the table the rows were retrieved from.&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This isolation level is typically used for transactions that access read-only tables and views and for transactions that execute &lt;span class=&quot;fixed&quot;&gt;SELECT&lt;/span&gt; SQL statements for which uncommitted data from other transactions will have no adverse affect.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;As the name implies, transactions running under the uncommitted read isolation level can see changes made to rows by other transactions before those changes have been committed. However, such transactions can neither see nor access tables, views, and indexes that are created by other transactions until those transactions themselves have been committed. The same applies to existing tables, views, or indexes that have been dropped; transactions using the uncommitted read will learn that these objects no longer exist only when the transaction that dropped &lt;/span&gt;&lt;a href=&quot;http://www.blogger.com/&quot; id=&quot;850&quot; name=&quot;850&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/&quot; id=&quot;N52277&quot; name=&quot;N522779EA06EC3-E817-48FE-A1C0-D359093B52ED&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;them is committed. (It&#39;s important to note that when a transaction running under this isolation level uses an updatable cursor, the transaction will behave as if it is running under the Cursor Stability isolation level, and the constraints of the Cursor Stability isolation level will apply.)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Real World example&lt;/u&gt; :&amp;nbsp; &lt;/em&gt;&lt;/strong&gt;Haven&#39;t you reserve the hotel yet?? ooh poor boy..&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;When a customer scans the database to obtain a list of available rooms for a given date range, you (the manager) will be able to &lt;em&gt;change the room rates for any room in the hotel over any date range&lt;/em&gt;. Likewise, other customers will be able to make or cancel reservations for any room in the hotel, including the room at which the customer is currently looking. In addition, the list of rooms produced for the first customer may contain records for rooms for which other customers are in the processing of reserving or canceling reservations.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Choosing the Proper Isolation Level&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;So how do you decide which isolation level to use? The best way is to identify which types of phenomena are unacceptable, and then select an isolation level that will prevent those phenomena from occurring. A good rule of thumb is:&lt;/span&gt;&lt;/div&gt;&lt;ul class=&quot;itemizedlist&quot;&gt;&lt;li class=&quot;first-listitem&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;853-2&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Use the Repeatable Read isolation level if you&#39;re executing large queries and you don&#39;t want concurrent transactions to have the ability to make changes that could cause the query to return different results if run more than once.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;ul class=&quot;itemizedlist&quot;&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;853-3&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Use the Read Stability isolation level when you want some level of concurrency between applications, yet you also want qualified rows to remain stable for the duration of an individual transaction.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;ul class=&quot;itemizedlist&quot;&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;853-4&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Use the Cursor Stability isolation level when you want maximum concurrency between applications, yet you don&#39;t want queries to see uncommitted data.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;ul class=&quot;itemizedlist&quot;&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;div class=&quot;first-para&quot; id=&quot;853-5&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Use the Uncommitted Read isolation level if you&#39;re executing queries on read-only tables/views/databases or if it doesn&#39;t matter whether a query returns uncommitted data values.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;last-para&quot; id=&quot;853-6&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Always keep in mind that choosing the wrong isolation level for a given situation can have a significant negative impact on both concurrency and performance—performance for some applications may be degraded as they wait for locks on resources to be released.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;strong&gt;Specifying the Isolation Level to Use&lt;/strong&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Although isolation levels control concurrency at the transaction level, they are actually set at the application level. Therefore in most cases, the isolation level specified for a particular application is applicable to every transaction initiated by that application. (It is important to note that an application can be constructed in several different parts, and each part can be assigned a different isolation level, in which case the isolation level specified for a particular part is applicable to every transaction that is created within that part.)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;ch07lev2sec6&quot;&gt;&lt;div class=&quot;para&quot; id=&quot;854-2&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;For embedded SQL applications, the isolation level is specified at precompile time or when the application is bound to a database (if deferred binding is used). In this case, the isolation level is set using the &lt;span class=&quot;fixed&quot;&gt;ISOLATION [RR | RS | CS | UR]&lt;/span&gt; option of the &lt;span class=&quot;fixed&quot;&gt;PRECOMPILE&lt;/span&gt; and &lt;span class=&quot;fixed&quot;&gt;BIND&lt;/span&gt; commands.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;para&quot; id=&quot;855-3&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;DB2 Version 8.1 and later provides a &lt;span class=&quot;fixed&quot;&gt;WITH&lt;/span&gt; clause (&lt;span class=&quot;fixed&quot;&gt;WITH [RR | RS | CS | UR]&lt;/span&gt;) that can be appended to a &lt;span class=&quot;fixed&quot;&gt;SELECT&lt;/span&gt; statement to set a specific query&#39;s isolation level to Repeatable Read (&lt;span class=&quot;fixed&quot;&gt;RR&lt;/span&gt;), Read Stability (&lt;span class=&quot;fixed&quot;&gt;RS&lt;/span&gt;), Cursor Stability (&lt;span class=&quot;fixed&quot;&gt;CS&lt;/span&gt;), or Uncommitted Read (&lt;span class=&quot;fixed&quot;&gt;UR&lt;/span&gt;). A simple &lt;span class=&quot;fixed&quot;&gt;SELECT&lt;/span&gt; statement that uses this clause looks something like this:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;informalexample&quot; id=&quot;N588&quot;&gt;&lt;pre class=&quot;literallayout&quot; id=&quot;855-4&quot;&gt;&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;SELECT * FROM employee WHERE empid = &#39;001&#39; WITH RR&lt;/span&gt;&lt;/em&gt;&lt;/pre&gt;&lt;pre class=&quot;literallayout&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;literallayout&quot;&gt;&lt;span style=&quot;font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;I hope after reading this article you will no more have any problems on isolation level.&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;para&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/6659453868169336351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/03/isolation-level-in-db2.html#comment-form' title='42 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/6659453868169336351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/6659453868169336351'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/03/isolation-level-in-db2.html' title='Isolation Level in DB2.'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>42</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-6435349868131164459</id><published>2011-03-05T01:09:00.000-05:00</published><updated>2011-05-24T21:04:24.442-04:00</updated><title type='text'>Understanding Locking in DB2 - IV</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;a href=&quot;http://db2guide.blogspot.com/2011/02/understanding-locking-in-db2-i.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Read Part-I&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-ii.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Read Part-&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;II&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-iii.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Read Part-III&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;u&gt;&lt;strong&gt;&lt;em&gt;Lock duration&lt;/em&gt;&lt;/strong&gt; &lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Lock Duration is a very important concept in locking when the lock states are not compatible with each other.This is the reason, you get those famous deadlock and timeout issues.So you should have sound knowledge of this concept before designing your program.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The duration of a lock is defined as the length of time a lock is held and varies according to the type of lock. Page or row locks are acquired when individual rows are accessed and are released at different times, depending on whether the data is accessed for read-only or for update and on the isolation level specified.High level locks are typically acquired implicitly, based on options specified at BIND or REBIND time.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Because DB2 does implicit high level locking, it is critical that the application designer understand the options that influence when high level locks are acquired, when they are released, and the state of the lock.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Duration of table space, partition, and table locks&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Every plan executed in DB2 must acquire a high level lock that can either be a table space or partition lock and, if the table space is segmented, then a table lock as well. The exception this rule is that locks are not acquired on the table space or table if uncommitted read isolation is specified. However, DB2 does acquire a mass delete lock. A mass delete is when a DELETE statement is executed with no WHERE clause such that all rows are deleted. DB2 uses the mass delete lock to serialize a mass delete process with an uncommitted reader.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;DB2 provides options to control the point at which the high level locks are requested.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The BIND and REBIND options &lt;u&gt;ACQUIRE and RELEASE&lt;/u&gt; is used to control when the &lt;u&gt;high level locks&lt;/u&gt; are taken and released.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The possible values for the ACQUIRE option are ALLOCATE and USE. If you use ACQUIRE(ALLOCATE), all of the needed locks on all of the table spaces, partitions, and tables used by the plan are acquired at the first SQL call. If you use ACQUIRE(USE), only the needed locks on the table spaces, partitions, and tables are acquired for a shorter time, as and when the objects are accessed.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;DB2 packages and dynamic SQL always use ACQUIRE(USE).&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The time when the high level locks are released is influenced by the RELEASE option. The possible values for this option are DEALLOCATE and COMMIT. If you use RELEASE(DEALLOCATE), the locks are released only when the thread terminates. If you use RELEASE(COMMIT), the locks are released at commit time unless there are held cursors. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Duration of page or row locks&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The duration of page or row locks depends on whether they are acquired and released in a read-only or read and write environment.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Read-only&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;BIND and REBIND &lt;u&gt;ISOLATION option&lt;/u&gt; controls when &lt;u&gt;page or row locks&lt;/u&gt; are acquired and released in a read-only environment.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The duration and number of page or row locks depend on the nature of the process and the value for the ISOLATION option specified at BIND or REBIND. The most common ISOLATION option is cursor stability (CS), which is the default as of DB2 9 for z/OS. With cursor stability as the ISOLATION option, DB2 returns committed data and provides stability of data under updateable cursors. If a query is answered through a work file, &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;For example, a concurrent thread may update the data in the database that generated the data in the work&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;file.The repeatable read (RR) isolation retains page locks even though the process logic moves through several pages in the same table during a unit of work. If the pages are accessed again, repeatable read provides repeatability: the data cannot be changed by any other concurrent process. This is true for read stability isolation also.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Read and write&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;A process that uses a cursor adds another dimension to locking. Pages read acquire a U-lock, initially indicating update intent. But before a column can be updated or a row can be deleted, the U-lock on the page is changed to an X-lock and is released at commit.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Here we&amp;nbsp;come to an end of this Understanding of locking series.I will explain Isolation level in detail in different post as this topic deserve it, due to its immense importance to the programmer.Then there are various other important concept in terms of locking as lock avoidance,timeout,deadlock etc. which will be covered in coming posts.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/6435349868131164459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-iv.html#comment-form' title='102 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/6435349868131164459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/6435349868131164459'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-iv.html' title='Understanding Locking in DB2 - IV'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>102</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-4501964139760430146</id><published>2011-03-03T15:05:00.000-05:00</published><updated>2011-05-24T21:04:24.443-04:00</updated><title type='text'>Understanding Locking in DB2 - III</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;a href=&quot;http://db2guide.blogspot.com/2011/02/understanding-locking-in-db2-i.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Read Part-I&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;a href=&quot;http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-ii.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Read Part-II&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;In this third installment ,we will discuss&amp;nbsp;the &lt;strong&gt;Compatibility rules &lt;/strong&gt;for lock states&lt;strong&gt;.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The major effect of the lock state is to determine whether one lock state is compatible with another. Locks of some states do not exclude all other users. Assume that process A holds a lock on a table space that process B also wants to access. DB2 requests, on behalf of process B, a lock of some particular state. If the lock mode of process A permits a request from process B, then the two lock states are said to be compatible.&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;If the two locks are not compatible, process B cannot proceed. It must wait until process A releases the lock.&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Compatibility of page and row lock states.&lt;/span&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;/em&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;I will just draw the table which will make you better understand it. &lt;/span&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSQS7x_AlnVmwnf2Q2u7AgzTUDQx-dxJhkHlXpucizZepeLdLSgPxEVHjaQ9Yr0rk-Oa1ROkUFubvo7IP1TBH-hz_IxcRHo1FEU3hKhSXNPBbPt0i-C_5Lv7hTIBC0LW6wnFRk9P5d3hyphenhyphenP/s1600/mmm.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;98&quot; l6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSQS7x_AlnVmwnf2Q2u7AgzTUDQx-dxJhkHlXpucizZepeLdLSgPxEVHjaQ9Yr0rk-Oa1ROkUFubvo7IP1TBH-hz_IxcRHo1FEU3hKhSXNPBbPt0i-C_5Lv7hTIBC0LW6wnFRk9P5d3hyphenhyphenP/s400/mmm.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This table shows whether page or row locks of any two states are compatible (Yes) or not (No). &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;No question of compatibility of page lock with a row lock can arise, because a table space cannot use both page and row locks.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Two or more processes can concurrently access data by using a page or row share lock (S lock). However, two or more processes cannot concurrently access data using a page or row update-intent lock (U lock). That is, only one process can acquire a U lock on a specific page or row at any instant. Even though a page or row may be U locked, other processes can access that page or row (but for read-only) by acquiring an S lock. If the process holding the U lock wants to do an update or delete, the U lock must be promoted to X lock before this can be&lt;br /&gt;
done. &lt;br /&gt;
&lt;br /&gt;
However, the promotion to an X lock does not occur if any other concurrent process holds an S lock on that page or row. Eventually, assuming the S locks are released before the timeout interval, the U lock is promoted to an X lock. While a page or row is U locked, if any other concurrent process wants to do an update or delete, it must first acquire a U or X lock, but has to wait and eventually either the U or X lock is acquired or a timeout occurs.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Compatibility of table space, partition, and table lock states&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Compatibility for table space, partition, and table locks is slightly more complex. &lt;br /&gt;
&lt;br /&gt;
Below table shows whether or not the high level locks of table space, partition, or table of any two modes are compatible.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL4Rwl8AllMfzJwvtk_jJiPWQ9mEq2nUoo_hxCW3SPimiHrjeL7boUI2cvoecE0ChmKOJx2chU6qi2Ox13zprI6HIGnkICoJAbbporUID7RkRFJk4EcSqRJ6cHAW7k4Qs6HZWAaF1_pZ-f/s1600/ttt.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;256&quot; l6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL4Rwl8AllMfzJwvtk_jJiPWQ9mEq2nUoo_hxCW3SPimiHrjeL7boUI2cvoecE0ChmKOJx2chU6qi2Ox13zprI6HIGnkICoJAbbporUID7RkRFJk4EcSqRJ6cHAW7k4Qs6HZWAaF1_pZ-f/s640/ttt.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The next and the final post on this topic will be coming soon, which will be on &lt;strong&gt;Lock duration&lt;/strong&gt;.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/4501964139760430146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-iii.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4501964139760430146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4501964139760430146'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-iii.html' title='Understanding Locking in DB2 - III'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSQS7x_AlnVmwnf2Q2u7AgzTUDQx-dxJhkHlXpucizZepeLdLSgPxEVHjaQ9Yr0rk-Oa1ROkUFubvo7IP1TBH-hz_IxcRHo1FEU3hKhSXNPBbPt0i-C_5Lv7hTIBC0LW6wnFRk9P5d3hyphenhyphenP/s72-c/mmm.jpg" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-4694184850885755985</id><published>2011-03-03T03:46:00.000-05:00</published><updated>2011-05-24T21:04:24.443-04:00</updated><title type='text'>Understanding Locking in DB2 - II</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
This is the second installment of locking concept ( Check the first part &lt;a href=&quot;http://db2guide.blogspot.com/2011/02/understanding-locking-in-db2-i.html&quot;&gt;here&lt;/a&gt;&amp;nbsp;).&lt;br /&gt;
&lt;br /&gt;
In first part, we saw how on various objects locks can be taken and the types of lock (Lock states) for those objects.&lt;br /&gt;
&lt;br /&gt;
In this part we are going to discuss in detail what are these different lock states and their meaning.In the sense when i say that there is an Intent share lock on my table then what does it exactly mean, what kind of lock my particular program holds and more importantly what kind of lock it allows to other application on the same object(resource).&lt;br /&gt;
&lt;br /&gt;
Let&#39;s first discuss for all the lock states for &lt;strong&gt;high level lock&lt;/strong&gt; (Table space, partition, and table).&lt;br /&gt;
&lt;br /&gt;
( If you have any problem in understanding the terms here such as high level and level locks or lock&amp;nbsp;state , then just check out the&amp;nbsp;&lt;a href=&quot;http://db2guide.blogspot.com/2011/02/understanding-locking-in-db2-i.html&quot;&gt;first&lt;/a&gt; part).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As discuss , there are the &lt;strong&gt;six possible lock states&lt;/strong&gt; for a high level lock :&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Intent share (IS)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;The lock owner can read data in the table space, partition, or table, but not change it. The lock owner may acquire an S(Share) lock on the row or page containing the row. Concurrent processes may both read and change data.&lt;/div&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Intent exclusive (IX)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;The lock owner and concurrent processes can read and change data in the table space,partition, or table. The lock owner acquires a U(Update) lock or S (Share) lock on a page or row. When the data is to be changed, the U lock or S lock is promoted to an X(Exclusive) lock. &lt;/div&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Share (S)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;The lock owner and concurrent processes can read, but not change, data in the tablespace, partition, or table.There are no S locks on a page or row.&lt;/div&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Update (U)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;The lock owner can read, but not change, the locked data. However, the owner can promote the U lock to an X lock and then change the data. Processes concurrent with the U lock can acquire an S lock and read the data, but no concurrent process can acquire a U lock. The lock owner does not need page or row locks.&lt;/div&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Share with intent exclusive (SIX)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;The lock owner can read and change data in the table or table space. Concurrent processes can read the data in the table or table space, but not change it. Only when the lock owner changes data is the X lock acquired on a page or row.&lt;/div&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Exclusive (X)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;The lock owner may read and change data in the table space or table. Only the concurrent processes using uncommitted read isolation may access the table space or table.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Now we will discuss the lock states for the &lt;strong&gt;low level locks &lt;/strong&gt;( Page and row).&lt;br /&gt;
&lt;br /&gt;
There are the &lt;strong&gt;three possible lock states&lt;/strong&gt; (S,U AND X) for the low level lock size of a page or row. &lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;u&gt;&lt;strong&gt;Remember (As mentioned in previous post) these LOCKS are applicable only if there is an intent lock on the table space or partition or the table).&lt;/strong&gt;&lt;/u&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Share lock&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;The lock owner and any concurrent process can read, but not change, the locked DB2 object. Other concurrent processes may acquire share or update locks on the DB2 object. Also called an S lock.&lt;/div&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The lock owner can read the DB2 object and has the intention to change it. Concurrent processes may acquire share locks and read the DB2 object, but no other process can acquire an update lock. Update locks are promoted to exclusive locks before DB2 actually changes the DB2 object. Promotion to exclusive lock may cause a suspension if other processes are holding share locks. Also called a U lock.&lt;/div&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong&gt;Exclusive&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Only the lock owner can read or change the locked data, with the following exceptions. Concurrent applications using uncommitted read isolation can read the exclusively locked data. Also, if lock avoidance techniques indicate that the exclusively locked data is require currency of data.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Fair enough, In next part we will discuss compatibility between various lock states.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/4694184850885755985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-ii.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4694184850885755985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/4694184850885755985'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-ii.html' title='Understanding Locking in DB2 - II'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-7582118697064814939</id><published>2011-02-28T11:07:00.000-05:00</published><updated>2016-07-05T13:09:05.046-04:00</updated><title type='text'>Understanding Locking in DB2 - I</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Locking in DB2 is the&amp;nbsp;least understood concept among the programmer&#39;s.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;There&amp;nbsp;are lots of chaos ranging from what is lock to why we need it to end up discussing what exactly is isolation level etc.and i don&#39;t blame them.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Some programmer&#39;s who have somewhat understanding about it ,they have there&amp;nbsp;different set of questions to ask on it ,such as&amp;nbsp;we have something called as LOCKSIZE parameter while creating tablespace, then we have bind parameter such as Isolation Level and Aquire and Release. Now what exactly the function of these parameter? do we need all of them for deciding the kind of lock DB2 will take on resource for my particular Application Program.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Well to answer these questions let me clarify first that , Locking is not as simple subject as to cover it into a single post , if one want to understand the detailing of it , it may take up reading fully dedicated book on it.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;I will try to explain the overview of it in this post and will&amp;nbsp;cover the various aspect of it in coming posts. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;em&gt;Well i will not dwell much into what is the definition of lock and why we need it . you can read it anywhere (better go for IBM manual )&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;So read on&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;There are three things which you need to understand first in order to get rid of the concept of Locking.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;-- The object on which the LOCK to be taken (That is Table,Page,Row etc.).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;It can also be called as size of&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the LOCK.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;-- The mode or type of Locking (Share,Update etc.).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;This controls the degree to which the resource &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;can&amp;nbsp;be &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;accessed concurrently &lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-family: inherit;&quot;&gt;by &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;multiple processes. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;-- The duration of lock.This refers to the length of time that the lock is held.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Now lets discuss the above mentioned point one by one.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;&lt;u&gt;&lt;em&gt;Lock Size&lt;/em&gt;&lt;/u&gt;&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The size of the lock determines how much data is within the scope of a lock (hence the term &lt;i&gt;lock size&lt;/i&gt;).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;For example, a page lock includes all rows on a page, while a row lock just covers a single row.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The lock size is determined by the LOCKSIZE parameter of the CREATE and ALTER TABLESPACE data definition language statements. The options are ANY, TABLESPACE,TABLE, PAGE, ROW.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;ANY is the default. TABLE should only be used for segmented table spaces. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;DB2 uses locks of the following sizes:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;– Table space&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;– Partition&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;– Table&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;–&amp;nbsp;Page&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;– Row&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Out of theses first three are high level locks(table space,partition,table) and the next two (page and row) are called as low level locks.The low level locks cannot be taken before taking the corresponding high level lock for them while high level locks can be taken directly ( except intent share, intent exclusive, and share with intent exclusive.) I know this statement&amp;nbsp;is bit of confusing here but had to go with flow,don&#39;t worry will explain below.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Lock state or lock mode&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The state of a lock, also called the mode, determines the type of access to the locked object permitted to the lock owner and to any other concurrent application processes. The lock states available for an object depend on the lock size. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;There are three possible states for a low level lock: &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;- Share&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;- Update&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;- Exclusive&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Now these three modes of locks are available for low level lock( page and row) while high level lock size have these three modes of locking with the addition of three intent locks referred to as intent share, intent exclusive, and share with intent exclusive. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The primary difference is that whenever an intent lock is held,DB2 also has to request a lock at the page or row level, hence the reference to low level locks.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The share, update, and exclusive locks at the table space, partition, and table level are also&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;referred to as gross locks because they do not require low level locks to be taken.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Now, i think you got what i was trying to say previously.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;When to&amp;nbsp;take a lock&amp;nbsp;?&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The low level locks, that is page and row are acquired when necessary while a process is being executed.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;When the high level locks, that is, table space, partition, or table, are acquired depends on the ACQUIRE BIND option.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;For ACQUIRE(ALLOCATE), the high level locks are acquired at the first SQL call. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;For ACQUIRE(USE), the high level locks are acquired at the first actual use of the table. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The ACQUIRE bind options have no influence on &lt;i&gt;when&lt;/i&gt; high level locks are acquired for dynamic SQL, which is always when the object is first accessed.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;So&amp;nbsp;until now we are clear with size and modes of lock. Lets revise it.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;We can have high level locks (lock size) which covers table,tablespace and partition also we have low level locks which are on row and pages.Then we have various modes of locking that is intent share,intent exclusive,share intent exclusive,share,update and exclusive.Out of theses six modes of locking , all six are applicable for high level locking while for low level locking only three modes( share,update and exclusive) are applicable.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Now,I must stop this post here so you can grasp it. Don&#39;t worry if you don&#39;t get the concept in one reading , go through the post number of times till you get clear picture out of it.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;In next post&amp;nbsp; i will discuss what all these six modes of locking exactly mean in detail and there compatibility with each other. Then we have the third attribute remaining to discuss that is duration of lock (May be one after the next post)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://db2guide.blogspot.com/2011/03/understanding-locking-in-db2-ii.html&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;strong&gt;&amp;gt;&amp;gt; Read Part II&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/7582118697064814939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/02/understanding-locking-in-db2-i.html#comment-form' title='190 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/7582118697064814939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/7582118697064814939'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/02/understanding-locking-in-db2-i.html' title='Understanding Locking in DB2 - I'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>190</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8741359738976860584.post-1178071743569606330</id><published>2011-02-27T03:26:00.000-05:00</published><updated>2011-05-24T21:04:24.443-04:00</updated><title type='text'>DB2 University</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Well well well this is very good news for the guys who want to learn and get certified in DB2.&lt;br /&gt;
&lt;br /&gt;
IBM has started new program called as DB2 University.It is dedicated to helping people get educated and certified in DB2.&lt;br /&gt;
&lt;br /&gt;
There are various free courses available on the site like .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;SQL Fundamentals I&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;DB2 Essential Training II&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;DB2 Essential Training III&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;IBM Data Studio Essential training&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each of these offerings will be delivered as &quot;instructor-led online&quot; (ILO) courses. Instructors will monitor forums and grade assignments and a final exam. Courses are planned for 4-6 weeks, with deadlines for each assignment. Courses may be taken simultaneously. Though some courses do have pre-requisites, they will not be enforced at this point. &lt;br /&gt;
&lt;br /&gt;
DB2 Essential Training I isn&#39;t considered an ILO course. The final exam will be worth 100 percent.&lt;br /&gt;
&lt;br /&gt;
AND WHAT MORE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ALL courses will offer &quot;prizes,&quot; including:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;FREE IBM certification vouchers&lt;/li&gt;
&lt;li&gt;50-percent discount certification vouchers&lt;/li&gt;
&lt;li&gt;&quot;Understanding DB2&quot; book (worth $60 U.S.)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
So what are you waiting for go and Register now at &lt;a href=&quot;http://www.db2university.com/index.php&quot;&gt;DB2university.com&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://db2guide.blogspot.com/feeds/1178071743569606330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://db2guide.blogspot.com/2011/02/db2-university.html#comment-form' title='26 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/1178071743569606330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8741359738976860584/posts/default/1178071743569606330'/><link rel='alternate' type='text/html' href='http://db2guide.blogspot.com/2011/02/db2-university.html' title='DB2 University'/><author><name>Nitin Gandhi</name><uri>http://www.blogger.com/profile/14544355031720876831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Uu6egaAPFH9drzvXHsiwOtPkT9p4RXhdugzGiJLSDyrSEqH-JfvmrQ1mqypecLIsqFcYAa-GaUT-qQLXtvFGXxrVla9nTxiDQ72dG6bGfqqD8ZhOddERoxSFVNmECQ/s220/IMG-20160509-WA0027.jpg'/></author><thr:total>26</thr:total></entry></feed>