IMS DB Program Specification Block (PSB):

IMSDB Database Description IMSDB Application Control Block

Advertisements


A PSB is the set of all PCBs that a application program using.

The application program can access only database which are defined in the PSB.

PSBs are generates by using PSBGEN and will be stored in a PSBLIB.

Program Specification Block is a set of one or more PCBs.

Program Specification Block defines the programs view of the database and application Programs access authority to database.

PSB defines the logical data structure.

PSB is made up of one or more PCBs (Program communication blocks).

PSB describes the database as a particular application program views it.

Program Specification Block is defined external to program and is required for IMS program.

For IMS DB application program has definition describes what the program can operate and what segments/ fields the program can use.

The PSB specifies

  • About the databases that application program will access.
  • The application program is sensitive to which segments in the database
  • The segments usage in the application program (inquiry or update)

A PSB consists of one or more program communication blocks (PCBs).

Whenever an application program needs to access a new segment on an existing database or whenever it needs to access a new database, the PSB must be altered.

Whenever the PCB modified, which are all PSBs using the PCB should be altered.

The PCB specifies the segments to the application program which can have access and the processing authorization for each segment.

The PCB can define for each database (or each view of the database) accessed by the application program.

Each PCB corresponding block should be coded in the application program’s linkage section.

The PCB corresponding block also called as I/O area of PCB.

The data I/O areas are used for communication between IMS and the application.

Normally PCBs are two types.

  • Actual database PCBs
  • Data Communication PCBs (IO PCB)

PCBs contain SENSEG (sensitive segment) and SENFLD (sensitive field) statements.

These statements allow specifying which segments and fields the application program can access.

If segment defined as a sensitive, it will be accessible to the application.

If segment not defined as a sensitive, it will be ignored by the application program.

The PSB macros are used as input to the PSBGEN utility, a macro assembler that generates a PSB control block.

The PSB control block is stored in the IMS.

The PSBLIB library used for during database processing.

  • One DBD have more than one PSB.
  • Let’s discuss about arguments in detail below.

PCB

PCB Defines the database to be accessed by the application program.

The statement defines the type of operations allowed by the application program.

Each database requires a its own PCB statement.

PSB generation allows for up to 255 database PCBs.

SENSEG

SENSEG defines the segment types to where the application program will be sensitive.

A separate SENSEG statement is required for each segment type.

If segment is defined as sensitive, all the segments in the path from the root to that segment must also be defined as sensitive.

A segment can be exempted in the path from sensitivity by coding PROCOPT=K in the SENSEG statement.

These statements allow specifying which segments the application program can access.

If segment defined as a sensitive, it will be accessible to the application.

If segment not defined as a sensitive, it will be ignored by the application program.

SENFLD

SENFLD defines the fields in a segment type to the application program treats is sensitive.

SENFLD can be used in association with field-level sensitivity.

These statements allow specifying fields the application program can access.

If fields defined as a sensitive, it will be accessible to the application.

If fields not defined as a sensitive, it will be ignored by the application program.

PROCOPT

Specifies defines the type of access to a database or segment.

PROCOPTs can be used on the PCB or SENSEG statements.

Primary PROCOPT codes are as follows:

G GET or READ Function.
Read only.
I Insert Function
R Replace Function
Replace, includes G
D Delete Function
Delete, includes G
A All Options (G, I, R, D)
Get and update, includes G, R, I, D
L Load Function (Initial Loading)
Load database
LS Load Function (Loading Sequentially)
K Key Function - Access only key of the segment.
used on SENSEG statement
O Used with G option to indicate that HOLD is not allowed.
P Path Function (Used during Path Calls)

CMPAT = Y, To guarantee that the program using the PSB will always be given an IO-PCB at run time.

PSBs are generates by using PSBGEN and will be stored in a PSBLIB.

Let ‘s take below example to create the PSBLIB.

The below is the sample DBD for the simple company structure.


PSB
	PCB     TYPE=DB,NAME=COMPNYDB,PROCOPT=GRP,KEYLEN=10 
	SEGM	NAME=COMPANY,PARENT=0,BYTES=10
	FIELD	NAME=(CMPNCODE,SEQ,U),BYTES=10,START=1,TYPE=C
	SEGM  	NAME=PROJECT,PARENT=COMPANY,BYTES=5
	FIELD	NAME=(PROJCODE,SEQ,U),BYTES=5,START=1,TYPE=C
	SEGM  	NAME=BENCH,PARENT=COMPANY,BYTES=11
	FIELD	NAME=(BNCHCODE,SEQ,U),BYTES=11,START=1,TYPE=C
	SEGM  	NAME=PROJEMPL,PARENT=PROJECT,BYTES=15
	FIELD	NAME=(PEMPID,SEQ,U),BYTES=4,START=1,TYPE=C
	FIELD	NAME=(PEMPNAME,SEQ,U),BYTES=11,START=1,TYPE=C
	SEGM  	NAME=BNCHEMPL,PARENT=BENCH,BYTES=15
	FIELD	NAME=(BEMPID,SEQ,U),BYTES=4,START=1,TYPE=C
	FIELD	NAME=(BEMPNAME,SEQ,U),BYTES=11,START=1,TYPE=C
	PSBGEN 	LANG=COBOL,PSBNAME=CMPNPCB1 
	END 
 

IMSDB Database Description IMSDB Application Control Block

Advertisements