Program Communication Blocks
This topic discussed what are program communication blocks (PCB), what the program does, multiple PCBs,data sensitivity, PROCOPT processing options, the K option, the PCB statement, the KEYLEN parameter, and sensitive segment (SENSEG) statements.
program communication block(PCB) selects segments from a specific physical or logical DBD. An application using the PCB has access to only those segments that are selected. Usually, a PCB selects only a subset (or subhierarchy) of the segments defined in a DBD, but it
canselect all of the segments.
Multiple PCBs can be defined for the same DBD, each selecting a different subset of the defined segments. PCBs can overlap so that the same segment(s) can appear in different PCBs. Multiple applications can share the same PCB, but through different program specification blocks (described later in this section).
This topic contains the following information:
Data Sensitivity and the PROCOPT Options
What is Data Sensitivity
In DL/I, an application's
data sensitivityrefers to those segments that are available to the application via the PCBs it uses. In terms of data sensitivity, the basic purpose of a PCB is to effectively mask out segments from an application.
PROCOPT Processing Options
The PROCOPT processing options provide a number of access controls in addition to the basic access control based on including or excluding a segment. PROCOPT options let you further qualify access to specified segments. For example, PROCOPT=G permits the program to GET (that is, read) a segment. Some PROCOPT options can also be specified for the entire DBD, thereby restricting access on the database level itself.
The PROCOPT options include:
- G── Get (retrieve) access
- R── Replace (update) access
- I── Insert access (to store new segments)
- D── Delete access
- P── Path calls
- O── Get calls only (no hold)
- A── Any or all of the access options above
- L── Load access (for database loading)
- xS── Ascending sequence only for the option indicated byx(G, R, etc.)
- K── Key access only
Multiple options can be specified in the same PROCOPT parameter.
The K Option
The K option allows a PCB to restrict an application to only the key portion of a segment, while masking out the data portion. The K option is important because it removes access to a segment but still retains the hierarchical access path to the segment's dependents. By default, when a PCB masks out a segment, it also masks out the segment's dependent segments. The K option provides a way around this restriction.
Defining a PCB
The following example shows the source statements for a sample PCB:
PCB TYPE=DB,DBDNAME=DBDNEW,PROCOPT=G, KEYLEN=45,PROCSEQ=INDEX1 SENSEG NAME=SEGRT1,PARENT=0 SENSEG NAME=SEG3,PARENT=SEGRT1 SENSEG NAME=SEG4,PARENT=SEG3 SENSEG NAME=SEG2,PARENT=SEGRT1 PSBGEN LANG=COBOL,PSBNAME=PSB1 END
Figure 18. Sample PCB definition
The PCB Statement
To define a PCB, you must first specify the PCB statement. On the PCB statement, the DBDNAME parameter identifies a physical or logical DBD from which to select segments. The PROCOPT parameter specifies a PROCOPT option for the entire database.
The KEYLEN Parameter
The KEYLEN parameter specifies the maximum key length to be used when the key (sequence field value) of a segment is concatenated with the keys of the higher-level segments in its hierarchical access path. The KEYLEN value is determined by adding up the lengths of the sequence fields necessary to reach the lowest-level segment in the hierarchy of available segments.
Sensitive Segment (SENSEG) Statements
The bulk of a PCB definition consists of SENSEG (sensitive segment) statements. Each SENSEG statement specifies a segment to be included from the named DBD. The SENSEG statement can also include a PROCOPT option for the segment.