x
Syntax: How to Query a HOLD Master File
If the HOLD format option you select
creates a Master File, you can issue the following command to display
the fields, aliases, and formats in the HOLD Master File:
? HOLD
This
command shows field names up to 32 characters. If a field name exceeds
32 characters, a caret (>) in the 32nd position indicates a longer
field name.
If you have renamed the
HOLD file using AS filename, use the following syntax:
? HOLD filename
Tip: You
must issue the ? HOLD query in the same session in which the HOLD file
is created.
Example: Reporting Against a HOLD Master File
In the following HOLD file, the formats
shown are the values of the FORMAT attribute. You can see the values
of the ACTUAL attribute by displaying the HOLD Master File using TED
or any text editor. USAGE and ACTUAL formats for text fields specify
only the length of the first line of each logical record in the
HOLD file. The USAGE format is the same as the field format in the
original Master File. The ACTUAL format is rounded up to a full
(internal) word boundary, as is done for alphanumeric fields.
The following
request contains the query command ? HOLD, which displays the fields, aliases,
and formats in the associated Master File and creates a HOLD file.
TABLE FILE EMPLOYEE
SUM CURR_SAL AND ED_HRS
BY DEPARTMENT
LIST CURR_SAL AND ED_HRS AND BANK_ACCT
BY DEPARTMENT
BY LAST_NAME BY FIRST_NAME
ON TABLE HOLD
END
? HOLD
The output is:
NUMBER OF RECORDS IN TABLE= 12 | LINES= | 12 |
|
DEFINITION OF HOLD FILE: HOLD |
FIELDNAME | | | ALIAS | FORMAT |
| | | | |
DEPARTMENT | | | E01 | A10 |
CURR_SAL | | | E02 | D12.2M |
ED_HRS | | | E03 | F6.2 |
LAST_NAME | | | E04 | A15 |
FIRST_NAME | | | E05 | A10 |
LIST | | | E06 | I5 |
CURR_SAL | | | E07 | D12.2M |
ED_HRS | | | E08 | F6.2 |
BANK_ACCT | | | E09 | I9S |
You can now issue the
following report request against the HOLD file:
TABLE FILE HOLD
PRINT E07 AS 'SALARY OF,EMPLOYEE' AND LAST_NAME AND FIRST_NAME
BY HIGHEST E03 AS 'TOTAL,DEPT,ED_HRS'
BY E01
BY HIGHEST E08 AS 'EMPLOYEE,ED_HRS'
END
The output is:
TOTAL
DEPT EMPLOYEE SALARY OF
ED_HRS DEPARTMENT ED_HRS EMPLOYEE LAST_NAME FIRST_NAME
------ ---------- -------- --------- --------- ----------
231.00 MIS 75.00 $21,780.00 BLACKWOOD ROSEMARIE
50.00 $18,480.00 JONES DIANE
45.00 $27,062.00 CROSS BARBARA
36.00 $13,200.00 SMITH MARY
25.00 $9,000.00 GREENSPAN MARY
.00 $18,480.00 MCCOY JOHN
120.00 PRODUCTION 50.00 $16,100.00 MCKNIGHT ROGER
30.00 $26,862.00 IRVING JOAN
25.00 $11,000.00 STEVENS ALFRED
10.00 $9,500.00 SMITH RICHARD
5.00 $21,120.00 ROMANS ANTHONY
.00 $29,700.00 BANNING JOHN