IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Commit Processing in IMS DB.


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Mon Nov 12, 2007 6:42 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Nov 13, 2007 12:57 am
Reply with quote

Sorry, don't know about CICS but I will investigate. Get back to you later on.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Nov 13, 2007 3:51 am
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Nov 13, 2007 4:00 am
Reply with quote

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
View user's profile Send private message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Tue Nov 13, 2007 12:41 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Nov 13, 2007 5:19 pm
Reply with quote

Why are you terminating the PSB?
Back to top
View user's profile Send private message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Tue Nov 13, 2007 6:30 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Nov 13, 2007 7:06 pm
Reply with quote

Hmmmmm....I do not believe that you need to do that. Try taking out the last TERM and see what happens.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Tue Nov 13, 2007 8:33 pm
Reply with quote

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
View user's profile Send private message
Karthigaiselvan

New User


Joined: 11 Dec 2006
Posts: 35
Location: India

PostPosted: Wed Nov 28, 2007 6:43 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Nov 29, 2007 3:37 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts icetool empty file and not empty file... DFSORT/ICETOOL 5
No new posts CICS file processing using applicatio... CICS 3
No new posts filter COMMIT/ROLLBACK statements DFSORT/ICETOOL 13
No new posts Retrieving IMS message processing reg... CLIST & REXX 7
No new posts MXG - Processing Compressed DB2 SMF r... All Other Mainframe Topics 2
Search our Forums:

Back to Top