IMS DB Tutorial Learn Quickly

Checkpoint calls are not needed in the following programs:

• single-mode programs
• database load programs
• programs that access the database in read-only mode and with PROCOPT=GO that are short enough to be restarted from the beginning
• programs that have exclusive use of the database

IMS provides for two types of Checkpoint calls

Basic Checkpoint calls and symbolic Checkpoint calls. Basic check point calls can be used by any type of program, but they are the only type of Checkpoint call allowed for MPPs and IFPs.

Basic Checkpoint calls

These do not support MVS or GSAM files and do not support the Restart call. Symbolic Checkpoint calls can be used by BMPs and batch programs.

Symbolic checkpoints

allow a program to specify as many as seven data areas to be checkpointed. The Restart call restores these designated areas to the condition they were in when the symbolic Checkpoint call was issued.

A Checkpoint call produces the following results:


• IMS makes the changes to the database permanent.
• IMS releases the segment or segments it has locked since the last commit point.
• The current position in the database (except GSAM) is reset to the beginning of the database.
• IMS writes a log record (containing the checkpoint identification) to the system log.
• IMS sends a message (containing the checkpoint identification) to the system console operator and to the IMS master terminal operator.
• IMS returns the next input message to the program’s I/O area.
• If the program also accesses DB2, IMS tells DB2 that the changes the program has made can be made permanent. DB2 makes the changes to the DB2 database permanent.

Backout

  • IMS will back out changes to a database automatically if a MPP or BMP application program terminates abnormally before reaching a commit point. IMS also performs a backout if an application program issues a Roll backout call (ROLL), Roll Back backout call (ROLB), or Roll Back to SETS (ROLS) call.
  • So that IMS can perform the backout if needed, and so users will not receive information that may prove to be inaccurate, IMS holds output messages until a program reaches a commit point. In an abnormal termination of the program, IMS discards any output messages generated since the last commit point.
  • If an application program terminates abnormally while processing an input message, IMS may discard the input message, depending on the type of termination. In all cases, IMS backs out uncommitted changes and releases locks on any segments held since the last commit point. You can use DL/I calls to manually back out database updates.

The backout calls include:

  • ROLB
  • ROLL
  • ROLS

Set a Backout Point (SETS)

SET Unconditional (SETU) ROLB, ROLL, and ROLS calls produce three common results:

  • All database changes since the last commit are backed out.
  • All output messages (except EXPRESS PURG) since the last commit point are discarded.
  • All segment locks are released.

ROLB, ROLL, and ROLS calls differ in the following ways:

  • ROLB returns control to your program and places the first segment of the first message after the last commit point into the I/O PCB.
  • ROLL abends with user code 0778. All messages retrieved since the last commit point are discarded.
  • ROLB abends with user code 3303. All messages retrieved since the last commit point are returned to the message queue.
  • A SETS call can be used to set up to nine intermediate backout points to be used by the ROLS call. It can also be used to cancel all existing backout points. SETS can be combined with a ROLS call to back out pieces of work between the intermediate backout points. To set the intermediate backout point, issue the SETS call by using the I/O PCB and including an I/O area and a 4-byte token.
  • To back out database changes and message activity that has occurred since a prior SETS call, issue a ROLS call that specifies the token that marks the backout point you have selected. IMS then backs out the database changes made since the SETS token specified. It also discards all non-express messages since the token.
  • A SETU call operates like a SETS call except that it ignores certain conditions under which the SETS call is rejected. A SETS call is not accepted when unsupported PCBs exist in the PSB (PCBs for DEDB, MSDB and GSAM organizations) or an external subsystem is used.

Restart

A Restart (XRST) call lets a program to be restarted after an abnormal termination. It must be coded as the first call in the program. When the Restart call is used the following actions occur:

• The last message is returned.
• The database position is reestablished.
• Up to seven specified data areas are returned to their condition at the last checkpoint.

DL/1 Status codes

Blank -call completed successfully
AA – the alternate PCB contains a transaction code instead of a logical terminal as a destination
AB -segment I/O area is missing from call statement
AC – hierarchical error on insert or get call
AD – function argument is not coded correctly
AF -size of variable length record is invalid for GSAM get access
AH -invalid SSA encountered on insert call
AI -error opening database
AJ – SSA specified for the call is invalid
AK – field name specified for qualified SSA is incorrectly coded
AT – I/O area specified is too small
AU -length for SSAs specified exceeds the maximum allowed
DA -REPL or DLET attempted to change segment key field
DJ – get hold issued after REPL or DLET
DX -DLET violated delete rule for segment
FD -resource deadlock
GB -end of database reached on GN call
GC – attempted to cross unit-of-work boundary
GD – position in database lost
GE – segment not found
GG – processing with procopt of GON or GOT and concurrent update activity is occurring
GK -call completed successfully but different segment type on same level retrieved for GN or GNP call
GL – LOG request has an invalid log code
GP – GNP issued but parentage was not previously established
II – attempt to insert a segment with a duplicate key
IX – insert rule violation
LB – attempt to load a segment that already exists
LC – attempt to load a segment out of sequence
LD – attempt to load a segment whose parent does not exist
LE – hierarchical sequence in DBD does not match that in the segment to be loaded
RX – replace rule violation
TI – path to segment is invalid
TJ – DL/I is not active
VI – during an insert or update length of variable length segment is too long

Program Specification Block (PSB)

Series of macro statements that describe the data access characteristics of an application program.
PSB specifies:
• all databases that the application program will access
• which segments in the database that the application program is sensitive to
• how the application program can use the segments (inquiry or update)

To allow a program to access an IMS DB, a PSB has to be defined that includes all of the database references the program will be allowed to make. This PSB will be made up of a number of PCB (Program Communication Block) references – one for each IMS database pointer that the program requires.
PCB TYPE=DB, DBDNAME=EMPDBD, PROCOPT=AP, KEYLEN=30, POS=MULTIPLE
SENSEG NAME=EMPDATA, PARENT=0, PROCOPT=AP
SENSEG NAME=EMPEDU, PARENT=EMPDATA, PROCOPT=AP
SENSEG NAME=EMPPERS, PARENT=EMPDATA, PROCOPT=AP
—etc—-
PSBGEN LANG=ASSEM (or COBOL),PSBNAME=EMPPSB
END

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.