WRITAB
ANSI
The WRITAB instruction writes data to specific locations in a sector through tabbing and the Random Access Method. Using this instruction, specific data may be written without disturbing other data in the record. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
file
Required. A previously defined and opened FILE variable in which data is updated.
list
Required. Any combination of previously defined Character String Variables, Numeric Variables, string or numeric ARRAYs, or individual array elements, VARLISTs of string or numeric variables, or valid Disk I/O List Controls.
;
Optional. A semicolon indicating Partial I/O.
Flags Affected: NONE
Note the following:
{record} must be equal to or greater than zero since only the Random Access Method is supported with WRITAB. The first sector in the file is zero (0) and each subsequent sector increments the reference appropriately. The relative sector size defaults to 256 bytes but may be adjusted using the BUFFER/FIX/FIXED FILE declaration parameter.
{list} may be any combination of character string and/or numeric variables (including arrayed items), character string and/or numeric literals, Ctrl values and/or supported list controls separated by commas. If an arrayed variable is given without a specific array element designated, all elements of the array are processed.
Ctrl values and literals are written to the disk exactly as specified in {list}.
The supported list controls are as follows:
|
Control |
Function |
|
Enable space compression | |
|
Disable space compression | |
|
Disable *CDFON | |
|
Enable comma-delimited Field support | |
|
Disable *EDION | |
|
Enable Electronic Data Information support | |
|
Data is written in the case in which it was stored | |
|
Forces output of only the Logical String | |
|
Minus overpunch negative numeric variables | |
|
Disable *LL (default) | |
|
lower case characters are converted to upper case before being written | |
|
Zero-fill numeric variables | |
|
Blank-fill zero numeric variables |
The tab position is calculated from the beginning of the relative sector.
A semi-colon (;) has no effect since WRITAB does not automatically write the End Of Record (EOR) mark. If an EOR is desired, it must be specified in the variable list.
Space compression is disabled unless explicitly enabled through *+.
See Also: Example Code, READ (FILE), WEOF, WRITAB (FILE), Disk I/O Instructions
![]() |