WRITE (FILELIST)


 

The WRITE instruction transfers information from program variables into a disk file. Key construction and insertion is performed for each file defined in the FILELIST by the runtime.

 

 

[label]

WRITE

{filelist};[{list}]

 

Where:

label

Optional. A Program Execution Label.

filelist

Required. A previously defined and opened FILELIST variable defining the files to which the data is written and keys are inserted.

list

Optional. Any combination of previously defined Character String Variables, Numeric Variables, string or numeric ARRAYs, individual array elements, VARLISTs of string or numeric variables, or valid Disk I/O List Controls.

Flags Affected: NONE

Note the following:

  1. The key is extracted from the {list} variables. The data in the {list} variables is then written to the primary file of the FILELIST using the extracted key.

  2. The operation continues extracting and inserting keys for each of the secondary files ISAM or AAM files.

  3. Should an error occur during the operation, the data record is automatically deleted from the data file and all inserted keys are removed.

  4. All other aspects of the WRITE instruction are defined in the WRITE AFILE or WRITE IFILE topics.

 

 

See Also: Example Code, Disk I/O Instructions

 

 



PL/B Language Reference WRITE (FILE) WRITE (IFILE)