HPlogo FCOPY Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 5 FCOPY Functions

CHAR

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Displays the contents of a file, record by record, in the form of character symbols in ASCII code. CHAR displays character codes not represented by symbols in ASCII code as decimal points.

Syntax

   ;CHAR [;{HEX

            HEXO

            OCTAL} ] [;NORECNUM] [;TITLE=title] [;LANG=language]

Where:

OCTAL

Displays octal codes. Refer to the description of OCTAL in this section.

HEX

Displays hexadecimal codes. Refer to the HEX description in this section.

HEXO

Displays the data in hexadecimal and the record number in octal. Refer to the HEXO description in this section.

NORECNUM

Omits file identification information, record numbers, and word offset numbers from the display.

title

Is a character string to be used as the title of the display. If the tofile is a printer, the title is printed at the top of each page. Otherwise, the title is written only once, at the beginning of the tofile. The title may contain up to 62 characters, but may not be broken to be continued on the following line.

language

Is the name or number of the language in which to display character symbols. FCOPY uses the character definition table associated with the specified language. The default is NATIVE-3000. For more information, refer to the Native Language Support Reference Manual (32414-90001) for MPE V/E or the Native Language Programmer's Guide (32650-90022) for MPE XL.

File Attributes

The fromfile must have read access, and the tofile must have write access. The tofile is normally a list device such as $STDLIST but it can also be another device for intermediate storage. The record size for an intermediate storage device should be the same as that of the list device that will ultimately print the data, and must be equal to or greater than 60 bytes.

Operation

You can combine the CHAR function with the OCTAL, HEX, or HEXO functions, one at a time, to display numerical codes as well as character symbols. You may want to display numerical codes along with character symbols when, for example, the output device to which you are copying automatically upshifts lowercase characters, or when you encounter a disk or magnetic tape file with unknown contents (refer to "Notes" below).

The tofile can be a printer, terminal, or an intermediate disk file. If the tofile is a disk file, its records must be at least 60 bytes in length.

If you do not specify NORECNUM and words are repeated in the file, FCOPY suppresses the duplicate lines and displays a message in the form SAME TO XXXX-1, where XXXX is in octal. If the entire record consists of the same character, FCOPY displays at least one line of the repeated character before printing the SAME TO message, as shown in the following example. However, if all the characters are blanks in an ASCII file, or zeros in a binary file, FCOPY displays only the SAME TO message.

Restrictions

You cannot combine CHAR with VERIFY, NEW, EBCDICOUT, EBCDIKOUT, or BCDICOUT.

Notes

The FCOPY display functions that show both numeric codes and character symbols are particularly useful because they let you examine the contents of a file either at a terminal or in a printer listing.

Some devices are capable of displaying only uppercase Roman alphabetic characters. When you copy to such a device, the device controller automatically converts lowercase characters to uppercase. In such instances, you may want to combine character and numerical display functions to display the original character codes in addition to the character symbols.

Example

In the following example, the CHAR and OCTAL functions have been combined to show the correspondence between the two forms.

This combined command displays the contents of a file. CHAR suppresses terminal recognition of such things as control sequences imbedded in the file to which the terminal would otherwise be sensitive. Escape codes and other nongraphic control characters are shown as dots, allowing you to see the exact position within the file of all the displayable characters. Refer to the CLEAR function for relevant information.

For example,

FCOPY FROM=DISPL;TO=;OCTAL;CHAR



HP32212A.03.24 FILE COPIER (C) HEWLETT-PACKARD CO. 1984



DISPL RECORD 0 (%0, #0)



00000: 047157 073440 065563 020164 064145 020164 064555 062440 Now is the time

00010: 063157 071040 060554 066040 063557 067544 020155 062556 for all good men

00020: 020040 020040 020040 020040 020040 020040 020040 020040

00030: SAME:TO 000044-1



DISPL RECORD 1 (%1, #1)



00000: 052157 020143 067555 062440 072157 020164 064145 020141 to come to the

00010: 064544 020157 063040 072150 062440 070141 071164 074456 aid of the party.

00020: 020040 020040 020040 020040 020040 020040 020040 020040

00030: SAME: TO 000044-1



DISPL RECORD 2 (%2, #2)





00000: 015446 062104 052150 064563 020154 064556 062440 064563 .&dBThis line is|

00010: 020165 067144 062562 066151 067145 062056 015446 062100 underlined..&d@

00020: 020040 020040 020040 020040 020040 020040 020040 020040 

00030: SAME: TO 000044-1

EOF FOUND IN FROMFILE AFTER RECORD 2



3 RECORDS PROCESSED *** 0 ERRORS



END OF SUBSYSTEM
Feedback to webmaster