Using Text Fields in Output Files

Reference:

Text fields can be propagated to HOLD and SAVE files that have the following formats: ALPHA, WP, HTML, EXL2K, PDF, and FOCUS or XFOCUS. They can also be propagated to SAVB files. However, although a Master File is generated for format ALPHA, you cannot issue a TABLE request against a HOLD file of format ALPHA that contains text fields.

Reference: Rules for Text Fields in Output Files

  • You can include as many text fields in the file as needed. However, you must specify text fields after non-text fields in the display list (PRINT..., SUM..., and so forth).
  • You can specify only one text field in the display list, and no non-text fields, in a request that includes an ACROSS phrase.

The following rules apply to missing data for text fields in HOLD and SAVE files:

  • A blank line is valid data. An end-of-text mark indicates the end of the field.
  • If there is no text for a field, a single period (.) followed by blanks appears in the HOLD or SAVE file.
  • If MISSING=ON during data extraction, a period (.) is written out to the HOLD or SAVE file.
  • If MISSING=OFF during data extraction, a blank is written out to the HOLD or SAVE file.

See Handling Records With Missing Field Values.

In environments that support FIXFORM, due to limitations in the use of text fields with FIXFORM, the following restriction applies:

  • When you use the command FIXFORM FROM HOLD, the HOLD file may not contain more than one text field, and the text field must be the last field in the Master File.

When HOLD files are read using FIXFORM, the interpretation of missing text depends on whether the field's designation is MISSING=ON in the Master File, conditional ©) in the FIXFORM format description, or some combination of the two.

Example: Applying Text Field Rules in HOLD Files

The following request extracts data to a HOLD file named CRSEHOLD:

TABLE FILE COURSES
PRINT COURSE_CODE DESCRIPTION
ON TABLE HOLD AS CRSEHOLD
END

This produces the following data in the HOLD file CRSEHOLD:

101 This course provides the DP professional with the skills
needed to create, maintain, and report from FOCUS databases.
%$
200 Anyone responsible for designing FOCUS databases will benefit
from this course, which provides the skills needed to design large,
complex databases and tune existing ones.
%$
201 This is a course in FOCUS efficiencies.
%$

The first record of the HOLD file contains data for COURSE_CODE 101, followed by the DESCRIPTION field. The data for this text field extends into the next record, beginning at Column 1, and continues to the end of the HOLD record. It is immediately followed by the end-of-text mark (%$) on a line by itself. The next record contains new data for the next COURSE_CODE and DESCRIPTION.

If the report uses two text fields, the first record contains data for the first text field. After the end-of-text mark is written, the next text field appears. This formatting applies to all file formats except WP, in which the report is saved exactly as it appears on the screen.


Information Builders