Previous Topic: SUBTRACT StatementNext Topic: BuiltIn Functions


TRANSMIT Statement

The TRANSMIT statement sends a previously defined screen and receives the data the user entered. When input is received from the user, the TRANSMIT statement automatically validates and edits all the data according to editing rules specified in the panel definition.

The Creating Panel Definitions Guide describes how to define and maintain screens. Several statements and built‑in functions provide symbolic high‑level panel processing. See the REFRESH and RESET statements and the $PANEL functions.

This statement has the following format:

TRANSMIT panel_name [REINPUT] [CLEAR]

     [ CURSOR AT {HOME            }]
     [           {field_identifier}]
    
     [ALARM]
panel_name

The one‑ to eight‑character name of a panel.

REINPUT

Specifies that all fields on the panel for which $RECEIVED is true are still $RECEIVED true after the current TRANSMIT (when the panel is received again) regardless of whether you enter new values for those fields. REINPUT is used in situations where you are prompted repetitively until values for all required input fields are entered and validated. The entire panel is then processed in one action.

CLEAR

Resets all unprotected fields on the panel. All unprotected fields are sent with the output fill character and received back with the input fill character, unless they were modified. The statement TRANSMIT panel CLEAR is equivalent to the two statements:

CURSOR AT clause

Overrides the default position of the cursor when the panel is initially displayed.

Note: Positioning the cursor requires that the panel have at least one unprotected field.

HOME

Positions the cursor on the default field as defined. This option overrides a position set by a SET ATTRIBUTE statement.

The identifier of the field where the cursor is initially displayed.

Activates the bell (if you have one) on your terminal when the panel is sent to the screen.

Data you enter is sent when you press the Enter key, when you press any PF key (except function keys assigned for HELP or CLARIFY), and on a scroll if specified. See the description of the parameter fill‑in in the Creating Panel Definitions Guide.

Execution of subsequent TRANSMIT statements for the same panel sends the values of all fields the program or the user modified since the last TRANSMIT. For a fresh copy of the panel, use any of the following:

You can initialize fields on a panel by moving values to those fields before the TRANSMIT statement is executed.

A TRANSMIT statement automatically causes a CHECKPOINT. See the Creating Programs Guide for details.

The BACKOUT statement can restore the state of the database to the most recent CHECKPOINT, BACKOUT, or TRANSMIT statement, or SQL COMMIT or ROLLBACK statement.

The combination of the following circumstances enters the error procedure or invokes the WHEN ERROR clause of the FOR construct if the following tasks are performed:

The combination of the above results in a $ERROR‑CLASS='DVW' that can be handled in either an error procedure or in the WHEN ERROR clause of the FOR construct.

For CA Datacom SQL ANSI Mode and DB2: If a TRANSMIT executes in the logical scope of a FOR construct for SQL access, you must define the corresponding object (table or view) with at least one unique index to update it. See the FOR EACH/FIRST statement (SQL Access) in this chapter.

Example

<<SEND_ADDPNL>> PROC
    TRANSMIT ADDPNLN
    statements :to process panel ADDPNL
    SET NEXT_PANEL = 'MAINPNL'
ENDPROC