SAME RECORD AREA Clause

The SAME RECORD AREA clause specifies that two or more files are to use the same main storage area for processing the current logical record. All of the files may be open at the same time.
Note: The SAME RECORD AREA clause is intended to make efficient use of main storage. However, IBM® i virtual storage architecture eliminates the need for this clause, and the clause is supported for compatibility rather than for performance. Use of the SAME RECORD AREA clause actually degrades performance and increases program size.
Read syntax diagramSkip visual syntax diagram
SAME RECORD AREA Clause - Format

>>-SAME--RECORD--+------+--+-----+--file-name-3----------------->
                 '-AREA-'  '-FOR-'                

   .-------------.   
   V             |   
>----file-name-4-+---------------------------------------------><

A logical record in the shared storage area is considered to be both of the following:

The SAME RECORD AREA clause allows transfer of data from one file to another with no explicit data manipulation because the input/output record areas of named files are identical, and all are available to the user.

More than one SAME RECORD AREA clause may be included in a program. However: