BKERROR [ KSAM/3000 Reference Manual ] MPE/iX 5.0 Documentation
KSAM/3000 Reference Manual
BKERROR
A call to BKERROR returns a message corresponding to the status value.
CALL BKERROR (status, message)
Call this procedure in order to get a printable string of characters that
describes the condition that corresponds to the value of the status
parameter. The string of ASCII characters returned in message can be
printed as an error message.
PARAMETERS
status is a four-character string variable to which is returned
a numeric value in printable form following execution of
any of the procedures described in this section. The
value in status is used to derive the text in message.
(Required parameter)
message is a string variable which will contain the text
describing the error whose code has been returned to
status. This parameter should be dimensioned to at
least 72 characters in length. If the message length
exceeds the dimensioned length of message, a truncated
text is provided. (Required parameter)
USING BKERROR
The following example illustrates the use of BKERROR. Two strings are
dimensioned for message; one (M$) is sufficiently long, the other (N$)
causes truncation of the message. Assume that the status code in S$ is
the value "22".
10 DIM S$(4),M$(72),N$(24)
20 REM..S$ IS THE STATUS STRING
30 REM..M$ IS A SUFFICIENTLY LARGE STRING
40 REM..N$ IS TOO SMALL FOR THE MESSAGE
50 REM..ASSUME S$ CONTAINS THE VALUE "22"
60 REM..
:
100 CALL BKERROR (S$,MS)
110 PRINT "ERROR";S$(1;1);"DETAIL";S$(2);"";M$
120 CALL BKERROR (S$,M$)
130 PRINT "ERROR "S$(1;1);"DETAIL";S$(2);"";N$
RUN /----------------- full message
/-------------------------------------\
ERROR 2 DETAIL 2 INVALID KEY VALUE. DUPLICATED KEY VALUE
ERROR 2 DETAIL 2 INVALID KEY VALUE. DUPL
\----------------------/
\---------------- truncated message
In another example, BKERROR is called to retrieve the message
corresponding to the MPE file system error code returned when the first
character of status is "9".
10 DIM S$(4),M$(72)
:
50 IF S$(1;1)="9" THEN DO
60 CALL BKERROR(S$,M$)
70 PRINT"FILE ERROR";S$(2);"MEANS";M$
80 DOEND
Suppose the value returned in status is "9172", then the routine above
prints the following message when the program is run:
FILE ERROR 172 MEANS KEY NOT FOUND; NO SUCH KEY VALUE
A list of the MPE file system error codes and their meaning is contained
in Table A-1 of appendix A.
MPE/iX 5.0 Documentation