HP NonStop G-Series User Manual
Page 163
Creating an Enform Report From Measure Data
Measure User’s Guide — 520560-003
A- 5
Creating User-Defined Records
1. Decide on the field names and definitions. For example:
proc-time :=
((SUM(cpu-busy-time OVER cpu-num))/1000000)
sys-time :=
((SUM(cpu-busy-time OVER cpu-num WHERE
program-file-name CONTAINS "OSIMAGE"))/1000000)
disc-time :=
((SUM(cpu-busy-time OVER cpu-num WHERE
priority >= 220))/1000000)
user-time := (proc-time - sys-time)
CPU-BUSY-TIME and CPU-NUM are fields in the existing PROCESS record.
2. Create a file containing the DDL record definition for the fields of the new record.
This example defines a record, BUSYTIME, containing the fields listed under item
1:
RECORD busytime. FILE IS busytime.
02 cpu-num TYPE binary 16 unsigned.
02 proc-time TYPE binary 64.
02 sys-time TYPE binary 64.
02 disc-time TYPE binary 64.
02 user-time TYPE binary 64.
The RECORD statement defines the record structure. The FILE IS clause identifies
the file to contain the records. The 02 is the level number of the field within the
record. The level number indicates the field’s relationship to other fields within the
record. The field name follows the level number. The TYPE clause defines the data
type and size of the field.
For the full syntax and a complete explanation of the RECORD statement, see the
Data Definition Language (DDL) Reference Manual.
3. Add the new DDL record definition to the DDL dictionary that contains the Measure
DDL records. (For an explanation of how to create the DDL dictionary, see
Producing Structured Files of Measurement Data
Assuming that the DDL record definition appears in a source file named
BUSYDDLS, this command adds the record definition to the DDL dictionary on the
current subvolume:
DDL /IN BUSYDDLS/ DICT
4. Use an Enform FIND statement to assign values to the fields of the new record:
>OPEN process, busytime;
>FIND busytime
>(
>by process.cpu-num,
>proc-time := ((SUM(cpu-busy-time OVER
> process.cpu-num))/1000000),
>sys-time := ((SUM(cpu-busy-time OVER
> process.cpu-num WHERE program-file-name