IMS DB Tutorial Learn Quickly

Command Codes:

SSAs can include one or more command codes, which can change and extend the functions of DL/I calls.

Available command codes are:

C Supplies concatenated key in SSA
D Retrieves or inserts a sequence of segments
F Starts search with first occurrence
L Locates last occurrence
M Moves subset pointer forward to the next segment
N Prevents replacement of a segment on a path call
P Establishes parentage of present level
Q Enqueues segment
R Retrieves first segment in the subset
S Sets subset pointer unconditionally
U Maintains current position
V Maintains current position at present level and higher
W Sets subset pointer conditionally
Z Sets subset pointer to 0
– (null) Reserves storage positions for program command codes in SSA

DL/1 calls:

• CHKP – Checkpointing.
• DLET – Delete. This call deletes the segment retrieved by the last get-hold call using the same PCB.
• FLD – The FLD call is used to verify and, optionally, to update the contents of one or more fields in an MSDB segment.
• GU – Get Unique. If unqualified, this call retrieves (reads) the first segment in the PCB view (program view) of the database. If SSAs are specified, the call retrieves the first segment that satisfies qualifications specified by the SSAs.
• GN – Get Next. If unqualified, this call retrieves the next segment in the hierarchical sequence of the database. If SSAs are specified, the call retrieves the next segment that satisfies qualifications specified by the SSAs.
• GNP – Get Next within Parent. This call is like the GN call but is restricted to the subtree of the current parent. (The parent is described in the PCB.)
• GHU – Get Hold Unique. This call is like the GU call but also holds the segment for the next update call that uses the same PCB.
• GHN – Get Hold Next. This call is like the GN call but also holds the retrieved segment for the next update call that uses the same PCB.
• GHNP – Get Hold Next within Parent. This call is like the GNP call but also holds the segment for the next update call that uses the same PCB.
• INIT – get data availability status code.
• ISRT – Insert. This call adds new segments using the PCB specified.
• LOG – write a record to the system log.
• PCB – Schedules a PSB to allow database access
• POS – The POS or Position call is used with a DEDB to perform one of the following:
– retrieve the position of a specific sequential dependent segment
– retrieve the position of the last inserted sequential dependent segment
– find out how much free space is available within a DEDB area
• REPL – Replace. This call replaces the segment held from the last get-hold call using the same PCB with an updated segment that you provide. The get-hold call must be the last DL/I call that used the same PCB.
• ROLB – Rollback.
• ROLS – Dynamically backs out changes to the database to the last sync point, then returns control to the application program.
• SETS – Used to set intermediate backout points while updating the database. Setting backout (sync) points allows the program to restore the data in the database to its original condition if errors are encountered during processing.
• STAT – get IMS system statistical information
• TERM – Terminates the current PSB and database access after committing all database changes.
• XRST – Restart from a checkpoint.

The GOBACK statement:

  • In an IMS Cobol program GOBACK should be used because it returns control to DL/I. DL/I needs to do some “housecleaning” before acquiescing.
  • STOP RUN on the other hand does not return control to DL/I, causing unpredictable results.

Checkpointing and Restarting:

  • Because some programs do not have built-in commit points, IMS provides a means whereby an application program can request a commit point. This is done through a Checkpoint (CHKP) call.
  • A Checkpoint call tells IMS that the program has reached a commit point. A checkpoint provides a point from which the program can be restarted.

Checkpoint calls are primarily used in the following programs:

  • multiple-mode programs
  • batch-oriented BMPs
  • batch programs
  • programs running in a data sharing environment

Author: Srini

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