473,804 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

Mar 27 '06 #1
1 1834
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.

Mar 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
25710
by: Tom Walker | last post by:
I cannot get the WHERE statement to work correctly unless I use a literal with the LIKE. I want to use a working storage data name so that I can vary the WHERE statement. Example that works: WHERE DSNAME LIKE 'ABC%' Example that does not work:
3
2737
by: Joachim Klassen | last post by:
I'm currently working on a migration of a DB2 VM V7.2 database to DB2 UDB Linux V8.2. In the first stage the applications will stay on VM only the database will be migrated. Applications will be migrated in a second stage in the future. The connectivity between DB2 VM as a DRDA requester and DB2 UDB as DRDA server has been established. At a first look at the applications one thing came up: they use SQL INSERT via a CURSOR. This works...
7
13715
by: misha | last post by:
Hello. I was wandering if someone could explain to me (or point to some manual) the process of mapping the addresses of host variables by DB2. Especially I would like to know when DB2 decides to reinitialize the addresses and even more when it decides not to do it. Recently I've ben strucked with a problem of host variables defined in LINKAGE SECTION, and it took me some time to find the cause and solution for the problem.
1
3056
by: GnanaKumar | last post by:
hi, Can any one explain me how to execute COBOL program using Python scripts... do i need any third party tool to do this.. can you pls help me out regards, Gnana Kumar
2
6419
by: pompeyoc | last post by:
Hi, I am a newbie when it comes to stored procs and i would like to learn how to call a COBOL program from a stored procedure. The SP can either be an DB2 SQL SP or an external COBOL/DB2 SP. I can use either depending on which is more efficient. One of the older posts ("Calling a COBOL Subroutine from COBOL/DB2 Stored Procedure" Dec 2005) suggested this is possible but I couldn't follow the explanation and there wasn't any examples....
0
1327
by: SUBHASH SHRIRANG JADHAV | last post by:
Hi, I have one doubt in cobol db2 program, plz help me. Q. Write a cobol program to read a file and in which suppose two fields are there one is account no and another is acct name so take a particular acct no match it with one DB2 table (contains same field suppose). If it matches the same acct no in file with DB2 table then display that acct no and his acct name on to the screen or another file.
2
1198
by: Subhrangsu Chandra | last post by:
I have created a MF-COBOL Program which generates an another COBOL Program.Now I am in search of the system command which can compile the newly(I am calling it as "child") created program when I compile the parent program.I mean to say that when I compile the parent program then the child program shold also be compiled with its errors ,if any and should show the output of both the programs.
0
1254
by: saroravi | last post by:
How can we write a cobol program without using session table. how Front end (PB) retrieve the data
0
1455
by: Girish12 | last post by:
I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.