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 IBM® Connect:Direct®-defined structure that contains error information or status information. Pointer
resp_length A pointer to the length, in bytes, of the application buffer to receive the response. The API sets this parameter to the number of bytes returned. Pointer to number of bytes returned or 0 if you no longer want to receive responses. Setting this field to zero purges all queued responses.
resp_buffer A pointer to the application buffer that receives the command or submit response. This buffer should allocate 4096 bytes.

The format of resp_buffer is a free-form text record structure. Field names are four characters long and all uppercase. The data can be any length and can include blanks. The structure is:

field name=data | field name=data |...

For example:

SUBM = username | PNUM = 12 | PNAM = proc1 |...

A local buffer, with a size greater than or equal to that set by resp_length and filled in by ndmapi_recvresp() or ndmapi_recvresp_c().

The CLI passes the resp_buffer to AWK for parsing. Valid values include:

ADMN—IBM Connect:Direct administrator name

ADPH—IBM Connect:Direct administrator phone number

CCOD—Completion code



CSDS—Copy step start timestamp

CSPE—Secure+ enabled indicator

CSPP—Secure+ protocol

CSPS—Secure+ cipher suite


DBLW—Destination file blocks received

DBYW—Bytes written

DBYX—Bytes received

DCOD—Destination completion code

DDAY—Submit date

DDS1—Destination disposition 1

DDS2—Destination disposition 2

DDS3—Destination disposition 3

DESC—IBM Connect:Direct administrator description

DFIL—Destination file

DLDR—Download directory restriction

DMSG—Destination message ID

DNVL—Destination number of volumes

DRCW—Records written

DRUX—RUs received

DVCN—Destination file volume count

DVOL—Destination volume array

DVSQ—Destination file volume sequence number

ECMP—Extended compression ON or OFF

ECPR—Extended compression percentage

ECTP—Extended compression type

ETMC—Ela[sed clock time

ETMK—Elapsed kernal time

ETMU—Elapsed user time

FROM—Copy sending node


ICRC—CRC indicator

LCCD—Local completion code

LCLP—Local IP address and port number

LKFL—Link fail

LMSG—Local message ID

LNOD—Local node

MSGI—Message ID

MSGT—Message text

MSST—Short text

OCCD—Other completion code

OERR—Other node in error

OMSG—Other message ID

PACC—PNODE account

PCRC—CRC indicator

PFIL—Process file

PNAM—Process name


PNUM—Process number

PPMN—PDS member name



RECC—Record category

RECI—Record ID

RETA—Retain Process

RMTP—Remote IP address and port number

RSTR—Process restarted


SACC—SNODE account

SBID—Submitter node ID

SBLR—Source file blocks sent


SBND—Submitter node name

SBYR—Bytes read

SBYX—Bytes sent

SCMP—Standard compression

SCOD—Source completion code

SCPR—Standard compression percentage

SDDY—Schedule date

SDS1—Source disposition 1

SDS2—Source disposition 1

SDS2—Source disposition 2

SDS3—Source disposition 3

SELA—Elapsed time of the event

SFIL—Source file

SFSZ—source file size

SMSG—Source message ID

SNAM—Step name


SNVL—Source number of volumes


SRCR—Records read

SRUX—RUs sent

SSTA—Start time of the event

STAR—Start log date/time for record

STAT—Process status

STDL—Copy termination record (CTRC) log time

STIM—Schedule time

STOP—Stop time of the event

STPT—Stop time of the event (STOP duplicate)

STRT—Start time of the event (SSTA duplicate)


SUBM—Submitter ID

SUBN—Submitter node

SUMM—Summary output selector

SVCN—Source file volume count

SVOL—Source volume array

SVSQ—Source file volume sequence number

TIME—Submit time

TZDI—Local time zone delta from GMT


ZLVL—Zlib compress level

Zlib—memory level

Zlib—window size

resp_moreflag Indicates that more ndmapi_recvresp() or ndmapi_recvresp_c() calls must be issued for more information. This flag occurs only on select process and select statistics commands. None

The ndmapi_recvresp() or ndmapi_recvresp_c() function has the folliowing return codes:

Return Code Description

The function completed successfully.


An error occurred. Consult the error structure for detailed error status.


Data is truncated because the receiving buffer is too small.

Following is a sample ndmapi_recvresp() function:

int32 rc, resp_length;
int32 resp_moreflag;
char resp_buffer[makbuf];

rc= ndmapi_recvresp (error,