HPlogo MPE XL Native Language Programmer's Guide: 900 Series HP 3000 Computer Systems > Appendix D Converting 7-Bit to 8-Bit Data

N7MF8CNV Utility

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

N7MF8CNV converts data in EDIT/XL and other MPE text and data files from a Hewlett-Packard 7-bit national substitution character set to ROMAN8. The user is prompted for language and file type (text or data). For a data file, the user is prompted on each file for the starting position and length of each field (portion of a record) to be converted. For a text file, each record is converted as one field.

The user is prompted for the name of each file to be converted. Files are read one record at a time; each record is converted (or certain fields of it are converted for data files), and the result is written to a new temporary file. When all records have been read, converted, and written to the new file, the old (unconverted) copy is deleted, and the new one saved in its place. An exception to this is KSAM files, which are converted in place, rather than written to a new temporary file. A count of the number of records read and converted is displayed on $STDLIST.

This utility does not convert files containing bytes with the eighth bit set. This situation probably indicates a misunderstanding or error. The likely causes are:

  • File is not a text or data file.

  • File is a data file where the fields have been inaccurately located.

  • File was created on a terminal configured for 8-bit operation.

  • File has already been converted.

The maximum record length supported is 8192 bytes. The maximum number of fields supported in the records of a data file is 256.

If the file being converted contains user labels, these are copied to the new file without conversion. If a fatal error is encountered during the conversion (for example, 8-bit data or file system error found), the conversion stops, the old copy of the file is saved, and the new copy is purged. The data is unchanged. An exception to this is KSAM files. Since these are converted in place, some records may already have been modified. KSAM files (including key file) should be restored from the backup tape to ensure a consistent copy.

A CTRLY entered during conversion displays the number of records successfully converted, and conversion continues. On variable length data files, if a field or portion of a field is beyond the length of the record just read, a warning is displayed and that field is not converted on that record. Other fields on the same record are converted, and processing continues with subsequent records. After each file has been converted, the user is prompted for another file name.

In addition to the text and data options, there is a test conversion option that shows how the conversion algorithm operates. The test conversion option must be run from a terminal configured for 7-bit operation with the chosen national substitution set. The user is instructed to enter a string, and the result of the conversion is displayed. The user does not have to switch back and forth between 7-bit and 8-bit operation to see the result. Each character converted is displayed as a decimal value in parentheses rather than graphically. Other characters are displayed unchanged.

At any point in the program, a Return exits the current program level. A Return in response to a request for the starting position and length of a field in a data file indicates that the definition of fields is complete, and the program proceeds with the conversion of the data file. A Return entered in response to a request for a text file name indicates that the conversion of text files is complete; the program goes back to the question "Type of file to be converted?".

Feedback to webmaster