July 2013 8.5 Files 1423
Module 9244 Write to a file line by line
To write to a table, use Module 9246.
With Module 9244 you write line-by-line to an ASCII file.
Open the file with Module 9240.
If file is opened in "buffered" mode:
Processing time is shorter.
Files are saved to the hard disk only if more than 512 bytes are overwritten
in several calls, or if the file is closed.
The number of data specified in the transfer string is overwritten.
If file is opened in "record oriented" mode:
Processing time is longer.
The data is immediately saved to the hard disk.
Exactly one line is overwritten. If there is a difference in length, the
subsequent data is displaced by the difference.
Call:
PS D <File handle>
Number from Module 9240
PS B/W/D/K/S<String number, source data>
CM 9244
PL B/W/D <Number of written bytes (including LF)>
–1: Error code in W1022
Error code:
Marker Value Meaning
M4203 0 Line was written
1 Error code in W1022
W1022 2 Incorrect file handle
3 Incorrect string number
7 File system error
20 Module was not called in a spawn job or submit job