HP Integrity NonStop J-Series User Manual

Page 145

Advertising
background image

TAILORING AN APPLICATION
Restricting an Application to a Subset of Records for a Child Box

Restricting an Application to a Subset of Records for a Child Box

You can restrict an application to a subset of records for a
child box by allowing it to access only a single record for the
parent box. Suppose, for example, that you want to generate an
application that can access the employee records of only those
employees who belong to region 1 and branch 2. If this region
and branch information is also stored in a file that contains
general departmental information, you can make a box that
represents these departmental records the parent of the employee
records. You can then restrict the application to a subset of
the employee records by:

1. Including a VALUE clause in the DDL record description of the
departmental records. To limit the application to the subset
of employee records where the employees belong to region 1
and branch 2, the VALUE clauses in this record description
might appear as follows:

RECORD department-limit.
FILE IS dept KEY-SEQUENCED.
02 dept-num.
04 regnum PIC 99 VALUE 01.
04 branchnum PIC 99 VALUE 02.
02 department-name PIC X(18) VALUE "California South ".
KEY 0 IS dept-num.
KEY "dn" IS dept-name.
END

If the "dept" file already had a record description that did
not contain the appropriate VALUE clauses, you could add a
new record description for this file. When you add this new
record description to the dictionary, it is good practice to
use a different record name. (ENABLE can use more than one
record description per file, so long as the record lengths
are the same for both.)

2. Supplying ON as a value for the FILL and VALUES attributes
and OFF as a value for the DELETE, INSERT, READ, and UPDATE
attributes when you add the box that represents the "dept"
file, for example:

SET BOX RECORD department-limits
SET BOX VALUES ON, FILL ON
SET BOX DELETE OFF, INSERT OFF, READ OFF, UPDATE OFF
ADD BOX department-box

6-27

Advertising
This manual is related to the following products: