beautypg.com

Creating userdefined records, Creating user-defined records, Creating – HP NonStop G-Series User Manual

Page 162: User-defined records

background image

Creating an Enform Report From Measure Data

Measure User’s Guide 520560-003

A- 4

Creating User-Defined Records

The AS clause defines the PROC-TIME display format as F9.3. That is, PROC-TIME
values are displayed in the format

“nnnnn.nnn

” (9 character places including the

decimal, with 3 digits to the right of the decimal). The display format is important for
two reasons:

If the value calculated for a field is larger than the declared display format, the
calculated value is treated as an overflow, and the report field is filled with asterisks
(*).

The size of each field display format contributes to the overall length of each report
line. If the sum of the display format sizes and the spaces between the items is
larger than the number of characters available on a report line, each report line is
wrapped onto two lines of the listing or terminal display, which results in confusing
reports.

The HEADING clause defines the text used to label columns containing the
PROC-TIME variable. The slash specifies a line break, so HEADING “Process/Busy
Time/(seconds)” produces the heading:

Process
Busy Time
(seconds)
---------
.
.
.

This example uses the PROC-TIME variable in a LIST statement to calculate a new
report item from existing record fields:

>OPEN process;
>LIST BY cpu-num HEADING "CPU/Number",
>proc-time :=
>((SUM(cpu-busy-time OVER cpu-num))/1000000);

You can also use variables in the WHERE clause of a LIST command. However, only
the initial value of the variable is used when evaluating the WHERE clause.

You cannot use a variable in an aggregate. That is, a variable cannot be a BY item, an
OVER item, or the parameter of an Enform function.

Creating User-Defined Records

Like user-defined variables, user-defined records let you calculate new report fields
from existing fields. After declaring a field in a user-defined record, you can use that
field in an Enform aggregate, such as a LIST BY command.

Although a number of restrictions are placed on user-defined variables, no such
restrictions are placed on user-defined records. You can create new record fields by
performing calculations on existing record fields.

To define and assign field values to a new record: