In this section: |
When creating a report, you refer to fields in several parts of the request-for example, in display commands (PRINT, SUM, etc.), in sort phrases (BY, ACROSS), and in selection criteria (WHERE, WHERE TOTAL, IF).
Several methods are available for referring to a field. You can:
You can also view a list of all the fields that are included in the currently active data source, or a specified Master File. For details, see Displaying a List of Field Names and Listing Field Names, Aliases, and Format Information.
You can refer to an individual field in any one of the following ways:
In the following requests, DEPARTMENT is the complete field name, DPT is the alias, and DEP is a unique truncation of DEPARTMENT. All these examples produce the same output.
1. TABLE FILE EMPLOYEE PRINT DEPARTMENT END 2. TABLE FILE EMPLOYEE PRINT DPT END 3. TABLE FILE EMPLOYEE PRINT DEP END
Note: If you use a truncation that is not unique, the following message appears:
(FOC016) THE TRUNCATED FIELDNAME IS NOT UNIQUE : D
How to: Reference: |
In a request, you can qualify field names with the Master File name and/or the segment name. Field names are always displayed as column titles in reports, unless a TITLE attribute or an AS phrase is used to provide an alternative name. For related information, see Customizing Tabular Reports.
You may use the file name, segment name, or both as a qualifier for a specified field. This is useful when structures contain duplicate field names. All referenced field names and aliases may be qualified.
The SET FIELDNAME command enables you to activate qualified field names.
SET FIELDNAME = {NEW|OLD|NOTRUNC}
where:
Specifies that 66-character and qualified field names are supported; the maximum length is 66 characters. NEW is the default value.
Specifies that 66-character and qualified field names are not supported; the maximum length is 12 characters. The limit may be different for some types of non-FOCUS data sources.
Supports the 66-character maximum; does not permit unique truncations of field names.
EMPLOYEE.EMPINFO.EMP_ID
Is the fully-qualified name of the field EMP_ID in the EMPINFO segment of the EMPLOYEE file.
? SET displays the current value of FIELDNAME. In addition, a Dialogue Manager variable called &FOCFIELDNAME is available. &FOCFIELDNAME may have a value of NEW, OLD, or NOTRUNC.
When the value of FIELDNAME is changed within a session, JOIN and DEFINE commands are affected as follows:
All other changes to the FIELDNAME value have no effect on JOIN and DEFINE commands.
For additional information about using qualified field names in report requests, see the Describing Data manual.
If you want to generate a report that displays all of a segment's fields, you can refer to the complete segment without specifying every field. You only need to specify one field in the segment-any field will do-prefixed with the SEG. operator.
The segment PRODS01in the GGPRODS Master File contains the PRODUCT_ID, PRODUCT_DESCRIPTION, VENDOR_CODE, VENDOR_NAME, PACKAGE_TYPE, SIZE, and UNIT_PRICE fields.
SEGMENT=PRODS01 FIELDNAME = PRODUCT_ID FIELDNAME = PRODUCT_DESCRIPTION FIELDNAME = VENDOR_CODE FIELDNAME = VENDOR_NAME FIELDNAME = PACKAGE_TYPE FIELDNAME = SIZE FIELDNAME = UNIT_PRICE
To write a report that includes data from every field in the segment, you can issue either of the following requests:
1. TABLE FILE GGPRODS PRINT PRODUCT_ID AND PRODUCT_DESCRIPTION AND VENDOR_CODE AND VENDOR_NAME AND PACKAGE_TYPE AND SIZE AND UNIT_PRICE END 2. TABLE FILE GGPRODS PRINT SEG.PRODUCT_ID END
If you want to see a list of all the fields that are included in the currently active data source, you can issue the ?F field name query.
This is useful if you need to refer to a list of field names, or check the spelling of a field name, without exiting from the request process. It also shows you the entire 66-character field name. More information on all of the query (?) commands appears in the Developing Applications manual.
The ?FF query displays field name, alias, and format information for a specified Master File, grouped by segment. Like the ?F query, you may issue ?FF:
If your software supports MODIFY or FSCAN, you can also issue ?FF from these facilities.
Note:
Information Builders |