Programming Interface

Top  Previous  Next

All the APIs are written in C language, so, when calling from other languages, i.e. COBOL, programmer must take care about correct data type conversion.

xbm_display

This routine logs an information message on the XBM console. Upon successful completion, it returns 0 (zero) otherwise a non zero value is returned.

Prototype

int xbm_display(char *message, int length);

Parameters

Parameter

C type

COBOL type

Description

message

char *

PIC X

message to be logged

length

int

PIC S9(8) COMP-5

length of the message

COBOL call sample

call "xbm_display" using by reference message
                        by value     length of message

xbm_log

This routine logs a message with an user-defined level on the XBM console. Upon successful completion, it returns 0 (zero) otherwise a non zero value is returned.

Prototype

int xbm_log(char *message, int length, int level);

Parameters

Parameter

C type

COBOL type

Description

message

char *

PIC X

message to be logged

length

int

PIC S9(8) COMP-5

length of the message

level

int

PIC S9(8) COMP-5

level of the message:

0 - information
1 - warning
2 - error
3 - urgent

COBOL call sample

01  level pic s9(4) comp-5
 
call "xbm_log" using by reference message
                 by value        length of message
                 by value        level

xbm_accept

This routine instructs XBM to ask for operator input and return the value supplied by the operator. Upon successful completion, it returns the length of the data received otherwise a negative value is returned.

Prototype

int xbm_accept(char *message, int length, char *destination, int destlength);

Parameters

Parameter

C type

COBOL type

Description

message

char *

PIC X(n)

message to be logged

length

int

PIC S9(8) COMP-5

length of the message

destination

char *

PIC X(n)

data-area in which XBM returns the value

destlength

int

PIC S9(8) COMP-5

length of data-area

COBOL call sample

01  level pic s9(4) comp-5
 
call "xbm_accept" using by reference message
                 by value           length of message
                 by reference       data-area
                 by value           length of data-area