View previous topic :: View next topic
|
Author |
Message |
Karthigaiselvan
New User
Joined: 11 Dec 2006 Posts: 35 Location: India
|
|
|
|
Hi,
I've a CICS program accessing an IMS DB. We found in production that this program is getting the updates (made by itself) lost on some occassions. We tried to debug this issue in test region by simulating certain scenarios. Consider the 2 scenarios we simulated below.
1. We ran the program and trapped the code with break points in Trace master. We could see the updates (REPL call) are successful. we checked this by browsing the database. Later when TERM PSB call is executed, the status got lost from the DB. The time duration we had b/w the REPL & TERM calls is quite note-worthy when we debugged.
2. When we did not trap the code (not in debugging mode) and ran the program, the updates are correctly made.
Could a delay b/w REPL & TERM in a CICS program be causing the updates being lost? Any pointers? |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Sorry, don't know about CICS but I will investigate. Get back to you later on. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
If you are seeing the IMS REPL actually replacing the segment, and you have a return status code of blanks, then the REPL worked.
I do think that your CICS command TERM is "backing out" the update. In other words, IMS thinks that you have abended and is recovering. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Quote: |
TERM command
The Terminate (TERM) command is used to terminate a PSB in a CICSĀ® online program.
About the TERM command:
Format
Options
Usage
Example
Format
>>-EXEC--DLI--+-TERMINATE-+------------------------------------><
'-TERM------'
Options
No options are allowed with the TERM command.
Usage
If you want to use a PSB other than the one already scheduled, use the TERM command to release the PSB.
When you issue the TERM command, all database changes are committed and cannot be backed out. Because returning to CICS also terminates the PSB and commits changes, you need not use the TERM command unless you want to schedule another PSB, or commit database changes before returning to CICS.
No options are allowed with the TERM command. If your program subsequently needs a PSB that has terminated, it must reschedule that PSB by issuing another SCHD command.
In most applications, you do not need to use the TERM command.
Example
EXEC DLI TERMExplanation
This example shows how to terminate a PSB with the TERM command.
This topic can be found in: IMS Application Programming API Reference (8 MB)
|
|
|
Back to top |
|
|
Karthigaiselvan
New User
Joined: 11 Dec 2006 Posts: 35 Location: India
|
|
|
|
Quote: |
I do think that your CICS command TERM is "backing out" the update. In other words, IMS thinks that you have abended and is recovering. |
When i did TERM PSB immediately after REPL call, the updates are correctly committed and not lost. But when we do the TERM PSB a bit delayed, the updates are lost. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Why are you terminating the PSB? |
|
Back to top |
|
|
Karthigaiselvan
New User
Joined: 11 Dec 2006 Posts: 35 Location: India
|
|
|
|
Sandy,
I'm TERMinating the PSB to commit the updates made in REPL call. I did this TERM immedialtely after REPL call to figure out if this is a timing issue. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Hmmmmm....I do not believe that you need to do that. Try taking out the last TERM and see what happens. |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
In CICS IMS DB program if we need to commit the changes before CICS syncpoint then we need to issue TERM call. |
|
Back to top |
|
|
Karthigaiselvan
New User
Joined: 11 Dec 2006 Posts: 35 Location: India
|
|
|
|
Based on our research, we almost found that the updates are lost because of parallel processing by another program on the same record. That is, after program A issued REPL on the record, another program
(say B) STARTed from A does a GHU (before A issues TERM PSB to commit) and this GHU gets the old value for pgm B. We dont know why this is happening, since our DB is a DLI DB and successive GHU after REPL is expected to return the new data.
Any inputs why this is happening. Please let me know if additional details are needed. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Did you try the command code 'Q'?
Quote: |
Q Reserve a segment so that other programs will not be able to update it until you have finished processing and updating it. |
|
|
Back to top |
|
|
|