Use the following record functions to process tape files:
Example:
The following example illustrates how to write to a tape file.
CRTTAPF FILE(MYLIB/T1520TPF) DEV(TAP01) SEQNBR(*END)
LABEL(CSOURCE) FILETYPE(*SRC)
CRTSRCPF FILE(MYLIB/QCSRC) MBR(CSOURCE)
The CRTSRCPF command creates the physical file QCSRC with member CSOURCE in MYLIB. The following statements are copied to the tape file:
Figure 155. Sample Source Statements for Program T1520TAP
|
CRTBNDC PGM(MYLIB/T1520TAP) SRCFILE(QCPPLE/QACSRC)
Figure 156. T1520TAP -- ILE C Source to Write to a Tape File
|
This program opens the source physical file T1520TPF. The _Ropen() function file QCSRC contains the member CSOURCE with the source statements. The _Ropen() function opens the tape file T1520TPF to receive the C source statements. The _Rreadn() function reads the C source statements, finds their sizes, and adds them to the tape file T1520TPF.
CALL PGM(MYLIB/T1520TAP)
After you run the program, the tape file contains the source statements from CSOURCE.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.