COBOL Manual for TNS and TNS/R Programs
Tape Input and Output
HP COBOL Manual for TNS and TNS/R Programs—522555-006
27-13
Tape Files of Types Other Than HP
The FUP command in Example 27-7 copies the EBCDIC tape file on tape drive
$DRIVE1 to the existing disk file $TEN.APP3.PQ5, converting it to ASCII in the
process.
The FUP command in Example 27-8 creates the disk file $TEN.APP3.PQ5 from an
EBCDIC tape file composed of 10K records of 80 characters each. Your HP COBOL
program can access $TEN.APP3.PQ5 sequentially.
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.
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.
Example 27-6. Copying an EBCDIC File to a New ASCII File
FUP COPY $DRIVE1,$DRIVE2,EBCDICIN
Example 27-7. Copying an EBCDIC File to an Existing ASCII File
FUP COPY $DRIVE1,$TEN.APP3.PQ5,EBCDICIN
Example 27-8. Copying an EBCDIC File to an Existing ASCII File
FUP CREATE $TEN.APP3.PQ5, TYPE E, &
EXT (1000 RECS,1000 RECS), REC 80
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 a HP COBOL representation. (See Converting Other Data Types to
HP COBOL Data Types.)