Use the following record functions to process diskette files:
Example:
The following example shows how to write to a diskette file.
CRTDKTF FILE(MYLIB/T1520DKF) DEV(DKT02) LABEL(FILE1)
EXCHTYPE(*I) SPOOL(*NO)
CRTPF FILE(MYLIB/T1520DDI) SRCFILE(QCPPLE/QADDSSRC)
SHARE(*YES)
To create the physical file T1520DDI using the following DDS source:
|
|
OPNQRYF FILE((MYLIB/T1520DDI)) QRYSLT('DENTAL *GT 400') OPNSCOPE(*JOB)
CRTBNDC PGM(MYLIB/T1520DSK) SRCFILE(QCPPLE/QACSRC)
Figure 157. T1520DSK -- ILE C Source to Write Records to a Diskette File
|
The _Ropen() function opens the diskette file T1520DKF and the database file T1520DDI. The _Rreadn() function reads all database records. The _Rwrite() function copies all database records that have a value > 400 in the DENTAL field to the diskette file T1520DKF.
CALL PGM(MYLIB/T1520DSK)
The output to the diskette file is as follows:
|
After you run the program, the diskette file contains only the records that satisfied the selection criteria.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.