xIncorporating Data Fields in a Free-Form Report
The crucial element in any report, free-form or otherwise,
is the data. The data fields available in a request include data
fields in the Master File, cross-referenced fields, and virtual
fields created with the DEFINE command.
The sample request (see Request for EMPLOYEE EDUCATION HOURS REPORT) references all three types of data fields:
- ED_HRS is found
in the EMPLOYEE Master File:
"TOTAL NUMBER OF EDUCATION HOURS: <ED_HRS>"
- DATE_ATTEND
is found in the EDUCFILE Master File, which is cross-referenced
in the EMPLOYEE Master File:
"MOST RECENT COURSE TAKEN ON: <MAX.DATE_ATTEND>"
- CR_EARNED is
created with the DEFINE command before the TABLE FILE command, and
is referenced as follows:
"<10>| EDUCATION CREDITS EARNED <CR_EARNED>|"
You can also apply a prefix operator to a data field to select
a particular value (for example, the maximum value within a sort
group) or to perform a calculation (for example, to compute the
average value of a field). You can use any available prefix operator
in a free-form report.
In the sample request, the MAX prefix
operator selects the most recent completion date of an in-house
course:
"MOST RECENT COURSE TAKEN ON: <MAX.DATE_ATTEND>"
As is true with all types of reports, you must understand the
structure of the data source to use the prefix operators correctly.