SNAX/HLS Configuration and Control Manual
Step 5. Planning for Programming Standards
Planning the SNAX/HLS Environment
104705 Tandem Computers Incorporated 2–35
As long as individual fields are not accessed as destination fields, no problems arise.
As soon as a program accesses them as destination fields, either on a MOVE or on
some arithmetic operation, SCOBOLX insists that the resultant value be in the range 0
through 9,999 or -9,999 through 9,999, depending upon how the field was defined.
This problem can easily arise in the following situations:
When you set sequence number values on HLS-OPEN or OPEN-SESSION verbs
(particularly when trying to perform session recovery).
When you move sequence numbers (as provided in the RECOVERY-TAGS of send
and receive data requests) into application variables.
When you move sense bytes to or from verb data structures.
You should therefore take care in manipulating fields that are essentially binary. The
specific coding trick for avoiding the problem depends upon the application program.
To move data from a SNAX/HLS structure to an application structure, for example,
consider defining the application variable as:
pic S9(5).
or
pic S9(5) comp.
Either of these declarations defines a variable that can hold any value representable in
16 bits.
To move data from an application structure into a SNAX/HLS structure, take
advantage of the fact that all SNAX/HLS structures containing such problematic
integers are part of a lower-numbered group. For example, the HLS-OPEN verb has a
SEND-SEQUENCE-NUMBER, that is defined within the lower-numbered group,
RECOVERY-TAGS, as:
02 RECOVERY-TAGS.
03 SEND-SEQUENCE-NUMBER pic S9(4) comp.
03 RCV-SEQUENCE-NUMBER pic S9(4) comp.
The following application data definitions and coding segment can be used to move
arbitrary values safely into the dangerous fields: