Receiving Responses Using ndmapi_recvresp() or ndmapi_recvresp_c()

Use ndmapi_recvresp() or ndmapi_recvresp_c() to receive responses that are associated with a previous command sent from the application. Following is the format for ndmapi_recvresp() or ndmapi_recvresp_c():

int32

ndmapi_recvresp ERROR_H error int32 * resp_length, char * resp_buffer,

int32

* resp_moreflag

Following are the parameters for ndmapi_recvresp() or ndmapi_recvresp_c():

Parameter

Description

Value

 

 

 

error

A pointer to a Sterling

Pointer

 

Connect:Direct-defined structure that

 

 

contains error information or status

 

 

information.

 

 

 

 

resp_length

A pointer to the length, in bytes, of the

Pointer to number of bytes

 

application buffer to receive the

returned or 0 if you no longer

 

response. The API sets this parameter to

want to receive responses.

 

the number of bytes returned.

Setting this field to zero purges

 

 

all queued responses.

 

 

 

resp_buffer

A pointer to the application buffer that

A local buffer, with a size greater

 

receives the command or submit

than or equal to that set by

 

response. This buffer should allocate

resp_length and filled in by

 

4096 bytes.

ndmapi_recvresp() or

 

The format of resp_buffer is a free-form

ndmapi_recvresp_c().

 

 

 

text record structure. Field names are

The CLI passes the resp_buffer to

 

four characters long and all uppercase.

AWK for parsing. Valid values

 

The data can be any length and can

include:

 

include blanks. The structure is:

ADMN—Sterling Connect:Direct

 

 

 

field name=data field name=data ...

administrator name

 

For example:

ADPH—Sterling Connect:Direct

 

SUBM = username PNUM = 12

administrator phone number

 

 

 

PNAM = proc1 ...

CCOD—Completion code

 

 

CKPT—Checkpoint

 

 

CLAS—Class

 

 

DBYW—Bytes written

 

 

DBYX—Bytes received

 

 

DCOD—Destination completion

 

 

code

 

 

DDAY—Submit date

 

 

 

64Sterling Connect:Direct for UNIX: User Guide

Page 70
Image 70
IBM 4J manual Receiving Responses Using ndmapirecvresp or ndmapirecvrespc, Ndmapirecvresp or, Ndmapirecvrespc