SNAX/HLS Application Programming Manual

SCOBOLX Applications
SNAX/HLS Programming Standards
104707 Tandem Computers Incorporated 1–15
?source HLSDDT(rc^nams)
This section defines the names (not the values) of the various SNAX/HLS verb return
codes. Its primary use is to enable your program to convert return-code values into
the standard name (without the RC^ prefix and with all circumflexes [^] converted to
underscores). The data structure itself is defined as a P-relative string, as follows:
?SECTION RC^NAMS
STRING RC^^NAMS = 'P' := [
"ok ",
.....
"no_data_available ",
"rcwt_already_queued "];
LITERAL RC^^WIDTH = 23 ;
The following fragment of code illustrates how your program might extract the
characters, given a return code value of RC. Note, in particular, how the example tests
the value for legal ranges and uses the string width as defined by the literal.
IF rc >= rc^^first AND rc <= rc^^last THEN
BEGIN
index := (rc - rc^^first) * rc^^width;
Desired^Answer ':=' rc^^nams[ index ] FOR rc^^width;
END;
It is important to note that the strings provided here are directly related to the symbol
name. The CONVERT-ERROR-CODE request allows a translation capability and is
the preferred method if the text is to be readable. Also note that Desired^Answer,
(the recipient of the string) should be declared with the capability of holding a string
of the size defined by the string width literal.
Note Since LITERAL RC^^WIDTH is not in the RC^NAMS section, you must source section
RETURN^CODE^DEFINITIONS for this example to work.
Section VERB^NAMS
Use the following statement to include the VERB^NAMS section of the copybook in
your program:
?source HLSDDT(verb^nams)
This section defines the names (not the values) of the various SNAX/HLS verb codes.
Its primary use is to enable your program to convert verb-code values into the
standard name (without the VERB^ prefix and with all circumflexes [^] converted ).
The data structure itself is defined as a P-relative string, as follows:
?section VERB^nams
STRING VERB^^NAMS = 'P' := [
"open_session ",
.....
"receive_control_wait "];
LITERAL VERB^^WIDTH = 21 ;