30.06.2013 Views

File Management - IBM

File Management - IBM

File Management - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 1. <strong>File</strong> Types and Their Main Operations<br />

programs processing files for output, the last buffer of data is written.<br />

For those programs processing files for input, an end-of-file condition is<br />

forced for the next input operation.<br />

RELEASE<br />

Detaches a device or a communications session from an open file. I/O<br />

operations can no longer be performed for this device or session.<br />

CLOSE<br />

Detaches a file from a program, ending I/O operations. Any remaining<br />

data in the output buffer that has not been written will be written prior<br />

to the completion of the close.<br />

The operations listed above have certain restrictions based on file type and<br />

language support. For example, a program may not write to a file that has been<br />

opened for read only. Similarly, a read-by-key may not be issued for an ICF file.<br />

Since file overrides can occur during processing, an operation may not be allowed<br />

for the type of file that is ultimately being processed. See Chapter 3. Using<br />

overrides, for additional information.<br />

Table 1 on page 4 lists the file types and the main operations that are allowed.<br />

There are additional functions supported for some file types that are accomplished<br />

by additional operations or changes to these operations. For information on these<br />

additional functions and how the operations given here apply to display, tape, and<br />

diskette files, refer to either the Application Display Programming, SC41-5715-00 book<br />

or the Tape and Diskette Device Programming, SC41-5716-01 book. For equivalent<br />

information for database, ICF, DDM, printer, and save files, refer to the 5701 book,<br />

the 5442 book, the 5307 book, the 5713 book, and the 5304 book, respectively.<br />

Table 2 on page 6 and Table 3 on page 7 map the OS/400-supported operations<br />

given in Table 1 to the high-level language operations (BASIC, ILE C, ILE COBOL,<br />

PASCAL, PL/I, and ILE RPG programming languages) supported on the system.<br />

For additional information on each operation and how it correlates to the file<br />

declaration in the program, see the appropriate language information. Note that<br />

not all OS/400 operations are supported in all languages.<br />

<strong>File</strong> Types<br />

Operation<br />

OPEN<br />

Database Diskette Tape Printer Display ICF DDM Save<br />

Read X X X - X X X X<br />

Write X X X X X X X X<br />

Update X - - - X 1<br />

- X -<br />

Delete X - - - X 1<br />

- X -<br />

READ<br />

By relative<br />

record<br />

number<br />

X - - - X 1<br />

- X -<br />

By key X - - - - - X -<br />

Sequential X X X - X X X X<br />

Previous X - X - - - X -<br />

4 <strong>File</strong> <strong>Management</strong> V4R5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!