COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
ACCESS MODE SEQUENTIAL
FILE STATUS IS STATUS-KEY.
...
HP COBOL file description entry for a tape file:
FD MONTHLY-SALES
RECORD CONTAINS 80 CHARACTERS
LABEL RECORDS ARE OMITTED.
OBEY command file commands:
ASSIGN MONTHLY-SALES, =SALES^JAN86
SET DEFMODE ON
DELETE DEFINE =SALES^JAN86
ADD DEFINE =SALES^JAN86, CLASS TAPE, LABELS ANSI,&
VOLUME SLS1Q86, RECFORM F, RECLEN 80,&
BLOCKLEN 4000
RUN QUOTAS
CLEAR ASSIGN MONTHLY-SALES
DELETE DEFINE =SALES^JAN86
Tape Files of Types Other Than HP
If a system that is not an HP system creates a tape file, an HP COBOL program can still read it,
but might encounter features that are not HP features, such as:
• Labels
• Extended Binary Coded Decimal Interchange Code (EBCDIC)
• Packed-decimal or floating-point binary data
• Variable-length records
Labels are explained in Labeled Tape Files.
EBCDIC Files
To read an EBCDIC file, an HP COBOL program must include a CODE-SET clause in the file
description entry. The CODE-SET clause causes translation between the native USASCII character
code convention and the EBCDIC code convention for all input-output operations. For more
information about the CODE-SET clause—including restrictions—see CODE-SET Clause (page 172).
If you cannot include a CODE-SET clause in the file description entry for an EBCDIC file, you must
copy the EBCDIC file to an ASCII file with the File Utility Program (FUP) COPY command. The ASCII
file can be a tape file or an existing disk file. To create a disk file, use the FUP CREATE command.
The FUP command in Example 268 copies the EBCDIC tape file on tape drive $DRIVE1 to a tape
file on tape drive $DRIVE2, converting it to ASCII in the process.
Example 268 Copying an EBCDIC File to a New ASCII File
FUP COPY $DRIVE1,$DRIVE2,EBCDICIN
The FUP command in Example 269 copies the EBCDIC tape file on tape drive $DRIVE1 to the
existing disk file $TEN.APP3.PQ5, converting it to ASCII in the process.
Example 269 Copying an EBCDIC File to an Existing ASCII File
FUP COPY $DRIVE1,$TEN.APP3.PQ5,EBCDICIN
The FUP command in Example 270 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.
Reading and Writing Tape Files 845










