Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6-99
TRANSFORM Statement
On either the output or input phase, if the data is mapped through the Message Section,
the Message Section entry specifies which Working-Storage Section items to process.
In addition, the Message Section entry defines the characteristics of the data, including
order, format, and length.
If the data transformation capabilities of ordering, editing, and conversion are not used,
TRANSFORM acts as a move statement. You could program a series of data moves
from place to place by setting up a Message Section template and then invoking a block
move using TRANSFORM.
The following rules apply:
•
For either the output record or the input record, you cannot have different sections
represented within one record. Each record must contain all Working-Storage
Section items or all Message Section items. The compiler produces an error if either
record is made up of items from more than one section.
•
You can have different sections represented by the output record and the input
record. For example, the output record can be made up of items from the Working-
Storage Section and the input record made up of items from the Message Section.
•
At compile time, only limited edit rule checking is imposed. Compatibility between
output and input templates is not checked at compile time. For example, it is
possible to code the output of a PIC A field to be input into a PIC 9 field. The
compiler will not attempt to find this type of error.
•
At run time, checks will be made on the input and output sides to ensure that data
consistent with the specified data type is found. For example, a run-time error will
occur if either too much or too little data is available to satisfy the input
requirements. If an error is found, the ON ERROR clause will be executed and
TERMINATION-STATUS, TERMINATION-SUBSTATUS will be set accordingly.
Further, should a data editing error be detected during a TRANSFORM, the proper
FIELD-STATUS items will be updated to show the fields involved.
•
Refer to Appendix D, Errors for Message Section Statements, for an explanation of
the error numbers that can be found in the TERMINATION-STATUS special
register.
Consider the following SCREEN COBOL examples with multiple input records:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-SOURCE PIC X(102).
01 WS-CODE-MSG.
05 WS-SEL-CODE-FIELD PIC 9(4) COMP.
01 WS-DESTINATION-TEMP-1.
05 WS-DEST-1-FLD1 PIC X(50).
05 WS-DEST-1-FLD2 PIC X(50).
01 WS-DESTINATION-TEMP-2.
05 WS-DEST-2-FLD1 PIC X(30).