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-101
TRANSFORM Statement
DESTINATION-TEMP-1. If the select code is 64 or 74, TRANSFORM sends the
data through DESTINATION-TEMP-2.
TRANSFORM moves a number from 1 to 4 into the TERMINATION-STATUS
register depending on the position of the select code relative to the other possible
select codes.
°
If there are no errors, the TERMINATION-STATUS special register is set as
follows:
°
If TRANSFORM detects an error, it sets TERMINATION-STATUS to a value
that indicates the type of error and performs the procedure ERROR-HANDLER.
In the following example TRANSFORM looks for the select code 30 bytes from the
beginning of the input record. The position of the code-field, WS-SEL-CODE-
FIELD, in the Working-Storage record WS-CODE-MSG defines this offset. Also,
notice that the select codes are specified in Working-Storage data items SC1 and SC2
rather than with numeric literals.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-SOURCE PIC X(102).
01 WS-CODE-MSG.
05 PREFIX PIC X(30).
05 WS-SEL-CODE-FIELD PIC 9(4) COMP.
01 REPLY CODES.
05 SC1 PIC 9(4) COMP, VALUE IS 1.
05 SC2 PIC 9(4) COMP, VALUE IS 2.
01 WS-DESTINATION-TEMP-1.
05 WS-DEST-1-FLD1 PIC X(30).
05 WS-DEST-2-FLD2 PIC X(20).
05 WS-DEST-1-FLD3 PIC X(50).
01 WS-DESTINATION-TEMP-2.
05 WS-DEST-2-FLD1 PIC X(30).
05 WS-DEST-2-FLD2 PIC X(30).
05 WS-DEST-2-FLD3 PIC X(40).
MESSAGE SECTION.
01 MS-SOURCE PIC X(102) FROM WS-SOURCE.
01 DESTINATION-TEMP-1.
05 MS-DEST-1-FLD1 PIC X(30) TO WS-DEST-1-FLD1.
05 FILLER PIC 9(4) COMP.
Select Code TERMINATION-STATUS
44 1
54 2
64 3
74 4