Pathway/iTS TCP and Terminal Programming Guide
Programming for Intelligent Devices
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide—426751-001
6-8
Using TRANSFORM Statements
Using TRANSFORM Statements
The TRANSFORM statement lets you move multiple data items from one place in
working storage to another, converting them in the process by a single statement. You
can achieve the same results without the TRANSFORM statement, but you must use a
whole paragraph of MOVE statements to do so.
The data items specified in a TRANSFORM statement can be any mixture of 01-level,
group, or elementary items defined in the Working-Storage Section, the Linkage
Section, or the Message Section.
The two primary uses of the TRANSFORM statement are:
•
To disassemble incoming messages and scatter and convert, if necessary, the data
fields into diverse Working-Storage Section or Linkage Section locations according
to codes nested within the message itself.
•
To gather, and convert if necessary, individual data items from diverse Working-
Storage Section or Linkage Section locations and assemble them into a single
message to be passed to a server process by a subsequent SEND statement.
Example 1: Disassembling Input Messages
Assume the general format of messages being passed between a front-end process and
an IDS requester is as follows:
Then assume the presence of the following Working-Storage Section data declarations:
01 PROCESSING-STATE PIC X(4), VALUE "GO ".
01 MSG-OUT.
05 TRANSMISSION-HEADER.
10 OUT-REPLY-CODE PIC 9(4) comp.
10 OUT-SESSION-ID PIC 9(4) comp.
05 MSG-OUT-DATA.
10 OUT-SELECT-CODE PIC 9(4) comp.
10 OUT-DATA PIC X(100).
01 MSG-IN.
05 TRANSMISSION-HEADER.
10 IN-REPLY-CODE PIC 9(4) comp.
10 IN-SESSION-ID PIC 9(4) comp.
05 MSG-IN-DATA.
10 IN-SELECT-CODE PIC 9(4) comp.
10 IN-DATA PIC X(100).
01 CONTROL-RECORD-1.
05 CTL-FLD-1 PIC X(10).
05 CTL-FLD-3 PIC X(10).
05 CTL-FLD-5 PIC X(10).
05 CTL-FLD-6 PIC X(10).
4 Bytes 2 Bytes Up to 100 Bytes
Transmission Header Select Code Data or Control Information