Hi,
I have written two online programs. The first one uses PRDATA-FILE. The second one uses a logical file based on PRDATA-FILE. When the screen of the first online program is displayed, the screen of the second online program does not display records. Is this because PRDATA-FILE is locked by the first online program? How do I make the second online program display records?
Thanks in advance.
Software/Hardware used:
iSeries 820 / COBOL
ASKED:
April 11, 2012 10:12 AM
UPDATED:
April 26, 2012 7:43 PM
Not a COBOL guy but …
COBOL would not normally lock the file in a way that would prevent it’s use by other programs.
If it’s accessing the records for update it will lock the record(s). Your second program would not have a problem unless it’s attempting to access
for update
a locked record. The number of records locked would depend on COMMIT level (if you are using Commitment Control).
Phil
How do I make the second online program display records?
If we can’t see the relevant code for both programs, and the relevant definitions of the files, we can’t guess where something might be going wrong.
Show us what is running, please.
Tom
What happens if you run the second program without running the first online program?
Thanks for all your responses. The two programs are independent of each other. They both use PRDATA-FILE. When either is up on one session, the other program hangs in another session. Would like to know the syntax or technique to use for file sharing. Thanks in advance.
Would like to know the syntax or technique to use for file sharing.
Generally, sharing is the default. Usually, the question would be about how not to share. We’re likely to ask you what you’re doing to block sharing.
When either is up on one session, the other program hangs in another session.
Any answers are likely to come out of information about that. What do you mean by “the other program hangs”? What exactly do you see? What is the exact behavior that is visible? Does the hanging program fail to start at all? Can both programs start, but one program begins to “hang” later? If you wait a couple minutes, does any error message appear? Does the hanging program become free if you end the first program?
Tom
Are these programs designed to update existing data?
Please show us the file declaration section of your programs.
Thanks
Phil