COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 270 Copying an EBCDIC File to an Existing ASCII File
FUP CREATE $TEN.APP3.PQ5, TYPE E, &
EXT (1000 RECS,1000 RECS), REC 80
The preceding discussion does not completely explain FUP. There are many considerations involved
in choosing parameters for the COPY and CREATE commands. For details, see the Guardian
Programmer’s Guide.
CAUTION: The EBCDIC-to-ASCII conversion mechanism described in this topic handles data of
the type DISPLAY, but not data of the type COMPUTATIONAL. If an EBCDIC file does not have a
character format, do not use FUP or CODE-SET to change EBCDIC to ASCII, because this disturbs
the stored numeric values. Instead, convert directly from the foreign EBCDIC representation to an
HP COBOL representation. (See Converting Other Data Types to HP COBOL Data Types.)
Converting Other Data Types to HP COBOL Data Types
If your HP COBOL program must use packed-decimal or floating-point binary data from a tape file
that was not created on an HP system, be aware that the data from the tape file might be represented
differently from HP COBOL packed-decimal and floating-point binary data. For details on HP COBOL
packed-decimal and floating-point binary data representation, see USAGE Clause (page 203).
HP COBOL data types:
• BINARY or COMPUTATIONAL
BINARY and COMPUTATIONAL are synonyms. HP COBOL stores a COMPUTATIONAL data
item as a 2-byte, 4-byte, or 8-byte binary value, depending on the number of digits in its
picture:
StoragePicture
1 byteS9(01) - S9(04)
2 bytesS9(05) - S9(09)
4 bytesS9(10) - S9(18)
• DISPLAY
HP COBOL stores a DISPLAY data item as a sequence of ASCII characters, one for each digit.
If the data description entry specifies that the sign is separate from the value, a separate byte
is allocated for the sign, which is stored as an explicit plus (+) or a minus (-) character.
If the data description entry does not specify that the sign is separate from the value, the sign
is stored by setting the high-order bit of one byte of the data item—the high-order byte if the
sign is specified as LEADING; the low-order byte otherwise.
The value zero has neither a positive nor a negative sign.
Some examples of data descriptions and their corresponding stored values are:
Binary Value StoredData Description
00110000 00110101PIC S99 VALUE 5
00110000 10110101PIC S99 VALUE -5
00000000 00000000PIC S99 VALUE 0
00110000 00110101PIC S99 SIGN LEADING VALUE 5
10110000 00110101PIC S99 SIGN LEADING VALUE -5
00000000 00000000PIC S99 SIGN LEADING VALUE -0
846 Tape Input and Output










