COBOL/400 Language Help

Format 4 (TRANSACTION Nonsubfile)

Description
The WRITE statement releases a logical record to the file.
Format 4 (TRANSACTION Nonsubfile)
 
->->---WRITE record-name-1--*-----------------*--------------->
                          *FROM identifier-1*
 
->----*--------------------------------*--------------------->
     *-FORMAT-*----*-*-identifier-2-*-*
              *-IS-* *-literal-1----*
 
->----*----------------------------------*------------------->
     *-TERMINAL-*----*-*-identifier-3-*-*
                *-IS-* *-literal-2----*
 
->----*-------------------------------------------*---------->
     *-STARTING-*----*-*------*-*-identifier-4-*-*
                *-AT-* *-LINE-* *-literal-3----*
 
->----*------------------------------------------------------>1
     *-*-BEFORE-*-ROLLING-*-------*--*-identifier-5-*------->2
       *-AFTER--*         *-LINES-*  *-literal-4----*
                          *-LINE--*
 
1->---------------------------------------------------------->3
2->---*---------*--*-identifier-6-*-------------------------->4
     *-THROUGH-*  *-literal-5----*
     *-THRU----*
 
3->------------------------------------------*--------------->
4->---*-UP---*--*-identifier-7-*--*-------*--*
     *-DOWN-*  *-literal-6----*  *-LINES-*
                                 *-LINE--*
 
->----*------------------------------------------*----------->
     *-*-INDICATOR--*--*-----*--identifier-8----*
       *-INDICATORS-*  *-IS--*
       *-INDIC------*  *-ARE-*
 
->----END-WRITE----------------------------------------------><-
 

TERMINAL

The TERMINAL phrase specifies the program devices to which the output record is sent. If only a single program device file was acquired by the TRANSACTION file, the TERMINAL phrase can be omitted. That program device is always used for the WRITE. If the TERMINAL phrase is omitted for a WRITE operation to a TRANSACTION file that has acquired multiple program devices, the default program device is used.

identifier-3 or literal-2

The contents of literal-2 or identifier-3 must be the name of a program device previously acquired, either implicitly or explicitly, by the file. If you specify literal-2, it must be nonnumeric and 10 characters or less in length. If you specify identifier-3, it must refer to an alphanumeric data item 10 characters or less in length. A value of blanks is treated as if the TERMINAL phrase were omitted.

STARTING Phrase

The STARTING phrase specifies the starting line number for the record formats that use the variable starting line keyword. This phrase is only valid for display devices.

The actual line number on which a field begins can be determined by the following equation:

     Actual-line = Start-line + DDS Start-line - 1
 

Where:

Actual-line is the actual line number
Start-line is the starting line number specified in the program
DDS Start-line is the line number specified in positions 39 through 41 of the Data Description Specifications form.

The write operation is successful if:

identifier-4

Identifier-4 must be an elementary numeric item.

literal-3

Literal-3 must be a numeric literal.

ROLLING Phrase

The ROLLING phrase allows you to move lines displayed on the workstation screen. All or some of the lines on the screen can be rolled up or down. The lines vacated by the rolled lines are cleared, and can have another screen format written into them. This phrase is only valid for display devices.

You specify ROLLING in the WRITE statement that is writing a new format to the workstation screen. You must specify whether the write is before or after the roll, the range of lines you want to roll, how many lines you want to roll these lines, and whether the roll operation is up or down.

After lines are rolled, the field on these lines retain their DDS display attributes, for example, underlining, but lose their DDS usage attributes, for example, input capability. Fields on lines that are written and then rolled (BEFORE ROLLING phrase) also lose their usage attributes.

If any part of a format is rolled, the entire format loses its usage attributes. If more than one format exists, only the rolled formats lose their usage attributes.

literal-4 or -5, or identifier-5 or -6

All identifiers and literals must represent positive integer values. The roll starting line number (identifier-5 or literal-4) must not exceed the ending line number (identifier-6 or literal-5).

identifier-7 or literal-6

All identifiers and literals must represent positive integer values.

identifier-8

Identifier-8 must be either an elementary Boolean data item specified without the OCCURS clause, or a group item that has elementary Boolean data items subordinate to it.


[ Top of Page | Previous Page | Next Page | Table of Contents ]