If you use ILE C record I/O in your program, you must:
The example in Figure 40 can be rewritten as follows:
Figure 41. Example: Using ILE C Record I/O
#include <stdio.h> #include <recio.h> #define MAX_LEN 80 int main(void) { _RFILE *fp; _RIOFB_T *iofb; char buf[MAX_LEN + 1]; fp = _Ropen("MY_LIB/MY_FILE", "rr"); iofb =_Rreadn(fp, buf, MAX_LEN, __DFT); while ( iofb->num_bytes != EOF ) { buf[iofb->num_bytes] = '\0'; printf("%s\n", buf); iofb =_Rreadn(fp, buf, MAX_LEN, __DFT); } _Rclose(fp); return 0; }
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.