The following example copies data from the input file T1520ASI to the output file T1520ASO by using the same order in which they are added to the file T1520ASI. The _Rreadn() and _Rwrite() functions are used.
CRTPF FILE(MYLIB/T1520ASI) RCDLEN(300)
This creates a physical file T1520ASI.
joe 5
fred 6
wilma 7
CRTPF FILE(MYLIB/T1520ASO) RCDLEN(300)
This creates a physical file T1520ASO.
CRTBNDC PGM(MYLIB/T1520ASP) SCRFILE(QCPPLE/QACSRC)
This creates the program T1520ASP that uses the source code in Figure 128.
CALL PGM(MYLIB/T1520ASP)
The physical file T1520ASO contains the following data:
joe 5
fred 6
wilma 7
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.