Chapter 18. Conclusions for File I/O.

General rules.

  1. Always close your and only your files before leaving your procedures.
  2. Never read records one by one.
  3. Use Data In Memory (DIM) where applicable (e.g. when you have multiple actions on records).
  4. Handle the CMS stack properly, or avoid it if possible.
  5. Don't replace records in Variable format files.

What method to choose ?


Method Main advantage Other advantages Drawbacks
CMS Pipelines fast Possible to process the data 'while reading or writing' many built-in stages for common data handling VM/ESA only
EXECIO fast Can keep file open while processing +- compatible with OS/390 difficult syntax
XEDIT fast File in storage while processing many XEDIT commands to process the data Only VM/ESA Programming not natural
LINEIN, LINEOUT Portability with other REXX SAA platforms
slow on OS/2 and VM
CHARIN CHAROUT portability with other REXX SAA platforms fastest on OS/2
CSL calls general file I/O in VM/ESA, a must if you want the full function use for SFS same coding in all HLL, can use REXX for prototyping only VM/ESA complex REXX programming
NAMEFIND access to tagged data NAMES panel for update and query VM/ESA only

From this table, and from the results discussed in Appendix F. "Host versus Personal Systems", we can conclude this:

This was the last chapter for lesson 4.  You should now be in a good position to work on the exercises for this lesson.