Previous Topic: Mapped Format Files: Data Representation

Next Topic: DBCS Considerations When Using Files

Unmapped Format Files: Data Representation

Unmapped format UDBs, which are usually files created or processed by mechanisms other than NCL, can contain noncharacter hexadecimal data (for example, records can contain strings of binary zeros). When data is read from a file using unmapped mode, the entire record is read in byte-for-byte as is, and non-printables remain as they appeared on the file. The data is placed into variables in lots of 256 bytes (the maximum variable size) unless otherwise specified. If the data contains non-printables, expand the data to hexadecimal using the &HEXEXP statement before processing it. You can specify a length of 128 for each variable on the &FILE GET statement, so that no overflow occurs when the data is hexadecimal expanded.

Note: Most data formats are most conveniently processed using mapped format files and maps developed using Mapping Services.

When writing to an unmapped file, the contents of the output buffer are placed onto the file unchanged, including non-printables. If VARS= or ARGS is specified on the &FILE PUT/ADD statement, the contents of each of the variables are concatenated and placed onto the file. Any non-printables that were contained in the variables are also placed onto the file. If DATA= is specified on the &FILE PUT/ADD, substitution takes place on the buffer before it is written to the file.

If any of the variables specified following the DATA= operand contain non-printables, these are preserved. Spaces and text between variables is also written to the file.

For example, if the variable &A contains X'C100C1' and the variable &B contains X'C200C2', then after the following statement is executed:

&FILE PUT ID=MYFILE DATA=&A XXX &B

the following result appears on the file:

X'C100C140E7E7E740C200C2'

One of the principal uses for unmapped format processing is in the dynamic preparation of reports from NCL procedures (particularly on z/OS systems):

  1. An ESDS UDB is allocated dynamically to SYSOUT.
  2. Report lines are written in unmapped format.
  3. The UDB is then closed for immediate printing.

When using &FILE PUT/ADD to write to SYSOUT file, carriage control options are available to assist with report formatting.

Note: For more information about the PUT and ADD operands, see the &FILE verb in the Network Control Language Reference Guide.