IBM 4J manual Ndmerrenth

Page 68

C++ Function

C Function

Description

 

 

 

ndmapi_sendcmd()

ndmapi_sendcmd_c()

Sends commands to Sterling Connect:Direct.

 

 

You must provide the command text. The

 

 

resp_moreflag is a pointer to the flag

 

 

indicating that more responses are pending

 

 

for the executed command. Invoke

 

 

ndmapi_recvresp_c() for C programs or

 

 

ndmapi_recvresp() for C++ programs to

 

 

retrieve the extra responses. Only the select

 

 

process and select statistics commands

 

 

require the use of ndmapi_recvresp_c() for

 

 

use with C and ndmapi_recvresp() for use

 

 

with C++.

 

 

 

ndmapi_recvresp()

ndmapi_recvresp_c()

Receives responses to commands sent to

 

 

Sterling Connect:Direct. The contents of the

 

 

response buffer are returned.

 

 

 

ndmapi_disconnect()

ndmapi_disconnect_c()

Terminates the API connection.

 

 

 

Three types of Sterling Connect:Direct command responses are returned by these functions.

vInformational responses return information about the submitted command.

vData responses, stored in the resp_buffer, contain data records.

vError responses return ERROR_H, a pointer to a linked list of all errors found. The ID field values are fixed for use when debugging. The msgid, feedback, and rc fields are specified by Sterling Connect:Direct and are referred to in message text. The subst field points to a string that contains substitution variable information to be inserted appropriately in the message text. The error control structure keeps track of the current and total number of errors. You can move through the errors by using the next pointer in error entry blocks.

The following code defines the ERROR_H structure:

#define NDM_ERR_ENT_T struct NDM_ERR_ENT_S #define NDM_ERR_ENT_H NDM_ERR_ENT_T * #define NDM_ERR_CTL_T struct NDM_ERR_CTL_S

#define ERROR_H NDM_ERR_CTL_T * struct NDM_ERR_ENT_S

{

int32

id;

 

char

msgid[MSGIDLEN];

int32

feedback;

 

int32

rc;

 

char

*subst;

 

NDM_ERR_ENT_H

next;

};

 

 

struct NDM_ERR_CTL_S

 

{

 

 

int32

id;

 

int32

cur_entry;

int32

num_entries;

NDM_ERR_ENT_H

next;

};

 

 

Creating a Connection to Sterling Connect:Direct Using ndmapi_connect() or ndmapi_connect_c()

Use ndmapi_connect() or ndmapi_connect_c() to create a connection to Sterling Connect:Direct so that an application can send commands and receive responses

62Sterling Connect:Direct for UNIX: User Guide

Image 68
Contents User Guide Page User Guide Copyright IBM Corporation 1999 Contents Iv Sterling ConnectDirect for Unix User Guide Overview of the Command Line Interface CLI CommandsStarting the CLI Stopping the CLISample Command Option Description Value EntryCLI Job Control CdpnumCLI History Commands Overview of Sterling ConnectDirect CommandsCommand Command Abbreviation DescriptionAbbreviations for Common Sterling ConnectDirect Commands Parameter AbbreviationParameter Description Values Submitting a ProcessPname = A?PROD5 Parameter Description Values Username@hostname or user@localhost Id , pswdName host name nnn.nnn.nnn.nnn or Name nnnnnId ,pswd ,newpswd Snodeid fieldSpecify retain=initial Following command submits the Process named payroll Following command submits the Process named copyfilFollowing command submits the Process named copy.cdp Changing Process ParametersParameter Description Value Name generic listRemote node specification generic list Node specification, userid generic listDeleting a Process from the TCQ Number list Removing a Process from the Execution Queue Flush process command has the following optional parameters Stopping Sterling ConnectDirectViewing a Process in the TCQ Parameter DescriptionPname Locate the Process to view EX HC HE HI HO HR HS PE Following command displays the specified Process number Monitoring Process Status in the TCQAll EX HC HE HI HO HR HS PE Output from the command is displayed in the following table Determining the Outcome of a Process Dest=/path/file nameCaev Capr CAEV, Capr Record id listParameter Description Value Parameter Description Value Parameter Description Value Srcf=/path/file name Date day , hhmmss ampmGenerating a Detailed Output Report for a Process Running System Diagnostics Generating a Summary Report for a ProcessSelect Statistics Recid LOG Timepname Pnumber Stepname Ccod Fdbk MsgidCOMM.TRC Smgr Trace smgr pnode tnode=ath3500ry level=2 file=Smgp.trc Command Definition Overview of the Transmission Control QueueScheduling Sterling ConnectDirect Activity Scheduling Parameter Queue CommentsProgression of a Process Through the TCQ Execution Queue Status Comment Wait QueueElement Comment Timer Queue Hold QueueHeld for Call indicates that the Process was Introduction to Translation Tables Creating a Translation TableCompiling a Translation Table Using the ndmxlt Utility Example-Creating a Translation TableUsing Translation During File Transfer Operations Example-Modifying a Model Translation TableTranslation Table Error Messages Accessing Sterling ConnectDirect MessagesMessage File Content Diagnostic Number DescriptionFollowing is a sample ndmmsg command Message File Record FormatDisplaying Message Text Following are the parameters for the message file recordSterling ConnectDirect for Unix User Guide Using the Standalone Batch Compression Utility Following are the parameters for the cdsacomp utilityLevel-Compression level Memory-The amountNnnnn Source codepage, destinationCodepage Example-Precompress a Text File Example-Precompress a Text File With Codepage ConversionExample-Precompress a Binary File Example-Decompress a Text FileExamples-csdacomp Command Help Validate Configuration Files Configuration ReportsCfgcheck command has the following arguments Argument DescriptionGenerating a Configuration Report on the Base Installation Type the following command at a Unix promptSterling ConnectDirect Utilities Following example shows an excerpt from a sample report Sterling ConnectDirect Utilities Sterling ConnectDirect for Unix User Guide Program using the C++ API calls Introduction to Writing Custom ProgramsCompiling Custom Programs Compiler version to use for each platformPlatform Compile Command You want to create such as apicheckWriting Custom C Programs ++ Function DescriptionNdmerrenth Ndmnoerror NdmerrorNdmapirecvrespc Receiving Responses Using ndmapirecvresp or ndmapirecvrespcNdmapirecvresp or Parameter Description Value PNOD-PNODE Following is a sample ndmapirecvresp function SNOD-SNODEReturn Code Description TruncatedNdmapirecvresp or ndmapirecvrespc to retrieve Writing Custom C++ Programs Ndmapisendcmdc function call has the following return codesFollowing is a sample ndmapisendcmd function Selectstatistics or Selectprocess , the CLISterling ConnectDirect for Unix User Guide Method Description Parameter Return Values CdfailureFollowing is the ConnectDirectSession class header Cdsuccess = 0, Cdfailure =Writing Custom Programs Sterling ConnectDirect for Unix User Guide User Exit Programs User Exit FunctionsProgram Description Chown root exitskeletonGoodrc Errorrc Return CodeWaiting for a Message Using recvexitmsg or recvexitmsgc ExitprogramFollowing are the parameters for sendexitmsg or sendexitmsgc HeaderFile Open Exit Messages Overview of User Exit MessagesStatistics Exit Message Security Exit Messages FileopenoutputreplymsgGeneratemsg Validatemsg ValidatereplymsgExit Log Files User Exit Stop MessageCopy Control Block Copyright IBM Corp IBM Corporation J46A/G4 Bailey Avenue San Jose, CA Trademarks Sterling ConnectDirect for Unix User Guide Index Special characters Generatemsg Generatereplymsg Validatemsg Validatereplymsg Page Sterling ConnectDirect for Unix User Guide Page Product Number 5725-C99