IMS DB - PCB Mask


Advertisements

PCB stands for Program Communication Block. PCB Mask is the second parameter used in the DL/I call. It is declared in the linkage section. Given below is the syntax of a PCB Mask −

01 PCB-NAME.
   05 DBD-NAME         PIC X(8).
   05 SEG-LEVEL        PIC XX.
   05 STATUS-CODE      PIC XX.
   05 PROC-OPTIONS     PIC X(4).
   05 RESERVED-DLI     PIC S9(5).
   05 SEG-NAME         PIC X(8).
   05 LENGTH-FB-KEY    PIC S9(5).
   05 NUMB-SENS-SEGS   PIC S9(5).
   05 KEY-FB-AREA      PIC X(n).

Here are the key points to note −

  • For each database, the DL/I maintains an area of storage that is known as the program communication block. It stores the information about the database that are accessed inside the application programs.

  • The ENTRY statement creates a connection between the PCB masks in the Linkage Section and the PCBs within the program’s PSB. The PCB masks used in a DL/I call tells which database to use for operation.

  • You can assume this is similar to specifying a file name in a COBOL READ statement or a record name in a COBOL write statement. No SELECT, ASSIGN, OPEN, or CLOSE statements are required.

  • After each DL/I call, the DL/I stores a status code in the PCB and the program can use that code to determine whether the call succeeded or failed.

PCB Name

Points to note −

  • PCB Name is the name of the area which refers to the entire structure of the PCB fields.

  • PCB Name is used in program statements.

  • PCB Name is not a field in the PCB.

DBD Name

Points to note −

  • DBD name contains the character data. It is eight bytes long.

  • The first field in the PCB is the name of the database being processed and it provides the DBD name from the library of database descriptions associated with a particular database.

Segment Level

Points to note −

  • Segment level is known as Segment Hierarchy Level Indicator. It contains character data and is two bytes long.

  • A segment level field stores the level of the segment that was processed. When a segment is retrieved successfully, the level number of the retrieved segment is stored here.

  • A segment level field never has a value greater than 15 because that is the maximum number of levels permitted in a DL/I database.

Status Code

Points to note −

  • Status code field contains two bytes of character data.

  • Status code contains the DL/I status code.

  • Spaces are moved to the status code field when DL/I completes the processing of calls successfully.

  • Non-space values indicate that the call was not successful.

  • Status code GB indicates end-of-file and status code GE indicates that the requested segment is not found.

Proc Options

Points to note −

  • Proc options are known as processing options which contain four-character data fields.

  • A Processing Option field indicates what kind of processing the program is authorized to do on the database.

Reserved DL/I

Points to note −

  • Reserved DL/I is known as the reserved area of the IMS. It stores four bytes binary data.

  • IMS uses this area for its own internal linkage related to an application program.

Segment Name

Points to note −

  • SEG Name is known as segment name feedback area. It contains 8 bytes of character data.

  • The name of the segment is stored in this field after each DL/I call.

Length FB Key

Points to note −

  • Length FB key is known as the length of the key feedback area. It stores four bytes of binary data.

  • This field is used to report the length of the concatenated key of the lowest level segment processed during the previous call.

  • It is used with the key feedback area.

Number of Sensitivity Segments

Points to note −

  • Number of sensitivity segments store four bytes binary data.

  • It defines to which level an application program is sensitive. It represents a count of number of segments in the logical data structure.

Key Feedback Area

Points to note −

  • Key feedback area varies in length from one PCB to another.

  • It contains the longest possible concatenated key that can be used with the program’s view of the database.

  • After a database operation, DL/I returns the concatenated key of the lowest level segment processed in this field, and it returns the length of the key in the key length feedback area.

Advertisements