Unix Technical Forum

Mixing SQL and traditional I-O in an ILE COBOL program

This is a discussion on Mixing SQL and traditional I-O in an ILE COBOL program within the DB2 forums, part of the Database Server Software category; --> I am trying to convert an existing COBOL app from using exclusively tradional I-O (READ verb) to using a ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:31 AM
Fred
 
Posts: n/a
Default Mixing SQL and traditional I-O in an ILE COBOL program

I am trying to convert an existing COBOL app from using exclusively
tradional I-O (READ verb) to using a mix of traditional and and SQL.
Please don't ask why, my question is conceptual. After populating a
cursor from table A and displaying on the screen, a user makes a change
to record #2. The program tries to read record #2 using traditional
COBOL READ COMMAND in order to update it, yet gets an INVALID KEY
condition because the record has a lock on it from building the cursor.
My problem is that I cannot find how to release the lock on the record.
I have tried declaring cursor as insensitive, changed commitment level
to *CHG, closed the cursor before reading the record, all to no avail.
I am obviously conceptually deficient about how to define a "read only"
cursor that does not place a lock on the records, or how to release a
lock on a record in an ILE COBOL program. Thanks in advance for any
suggestions.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 07:32 AM
Phil Sherman
 
Posts: n/a
Default Re: Mixing SQL and traditional I-O in an ILE COBOL program

Your explanation of what you are doing is too vague to determine what is
happening. Try again with a better explanation of what you are trying to
do. Be sure to specify what type of traditional files you are using
(sequential , VSAM KSDS, VSAM RRDS, ISAM, etc) and please keep your
nomenclature consistant. Use ROW or TUPLE for table references and
RECORD for file access. Specify clearly where the data comes from and
exactly what you are trying to update.

Note that programs that read data and present it to a user can cause
data availability issues. The classic case is the user who leaves the
data displayed (and progarm waiting) while taking an hour lunch break.

Philip Sherman



Fred wrote:
> I am trying to convert an existing COBOL app from using exclusively
> tradional I-O (READ verb) to using a mix of traditional and and SQL.
> Please don't ask why, my question is conceptual. After populating a
> cursor from table A and displaying on the screen, a user makes a change
> to record #2. The program tries to read record #2 using traditional
> COBOL READ COMMAND in order to update it, yet gets an INVALID KEY
> condition because the record has a lock on it from building the cursor.
> My problem is that I cannot find how to release the lock on the record.
> I have tried declaring cursor as insensitive, changed commitment level
> to *CHG, closed the cursor before reading the record, all to no avail.
> I am obviously conceptually deficient about how to define a "read only"
> cursor that does not place a lock on the records, or how to release a
> lock on a record in an ILE COBOL program. Thanks in advance for any
> suggestions.
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:37 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com