Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
6-132
TRANSFORM Statement
On the input phase TRANSFORM processes the data from this internal buffer. The
data is stored directly into the Working-Storage Section or is mapped through a
Message Section template on its way to Working-Storage.
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.
•
For details on the error numbers that can be found in the TERMINATION-STATUS
special register, see Appendix D, Errors for Message Section Statements.
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.










