COBOL Manual for TNS and TNS/R Programs
Libraries and Utility Routines
HP COBOL Manual for TNS and TNS/R Programs—522555-006
13-121
GETASSIGNVALUE
portion
is an alphanumeric data item that supplies the identifier for the particular integer
part of the message to be retrieved. The identifier must be one defined for the
ASSIGN message (see Table 13-13). The first unused character position of
portion, if any, must be a space. Example:
05 PORTION PIC X(30) VALUE "SECEXT".
val
is a numeric data item into which the retrieved value is placed. This data item must
be COMPUTATIONAL and described with one to four nines. Example:
04 VAL PIC S9999 COMPUTATIONAL.
message-number
identifies a specific ASSIGN message. message-number can be a DISPLAY or
COMPUTATIONAL numeric data item, a numeric literal, or an expression enclosed
in parentheses. The value must evaluate to a positive integer. Example:
08 MESSAGE-NUMBER PIC S9999 COMPUTATIONAL.
Because each saved ASSIGN message is identified by a positive integer,
message-number refers to the integer value of the specific message. The set of
numbers associated with the ASSIGN messages are integers from 1 to N, where N
is normally the number of ASSIGN messages saved during the initial process
creation.
result
is a DISPLAY or COMPUTATIONAL numeric data item assigned the result
returned by GETASSIGNVALUE. Example:
05 RESULT PIC S9999 COMPUTATIONAL.
GETASSIGNVALUE operates on the saved ASSIGN messages. The program must
have included a SAVE directive to save the message.
GETASSIGNVALUE returns an integer value that indicates the outcome of this
operation. The integer values and their meanings are:
Value Meaning
0 The specified portion value was assigned to val.
-1 Failure due to a logic error; nothing is assigned to val. These are possible logic
errors:
•
The message number is not a positive integer.
•
The specified message does not exist.
•
The portion identifier is not correct. It does not identify a defined integer part
of an ASSIGN message, or it identifies a part that does not exist in the
specified message.