IBM 4J Writing Custom C++ Programs, Ndmapisendcmdc function call has the following return codes

Page 75

Parameter

Description

 

 

 

 

Value

 

 

 

cmd_id

A four-byte identifier of the command that was found in

Four-byte

 

the command text. Following are the four-byte

identifier

 

identifiers:

 

 

 

 

 

 

/**************Command IDs*******************/

 

 

#define CHANGE_PROCESS 0x43484750

/* "CHGP" */

 

 

#define DELETE_PROCESS

0x44454c50

/* "DELP"*/

 

 

#define FLUSH_PROCESS 0x464c5350

/* "FLSP" */

 

 

#define SELECT_PROCESS

0x53454c50

/* "SELP"*/

 

 

#define SELECT_STATISTICS 0x53454c53 /* "SELS" */

 

 

#define SUBMIT 0x5355424d

/* "SUBM" */

 

 

#define TRACE_API 0x41504920

/* "API " */

 

 

#define TRACE_CMGR 0x434d4752

/* "CMGR" */

 

 

#define TRACE_SMGR 0x534d4752

/* "SMGR" */

 

 

#define TRACE_PMGR 0x504d4752

/* "PMGR" */

 

 

#define TRACE_COM 0x434f4d4d

/* "COMM"*/

 

 

#define TRACE 0x54524143

/* "TRAC" */

 

 

#define STOPNDM 0x53544F50

 

/* "STOP" */

 

 

The CLI uses these identifiers to ensure that rules are

 

 

being followed. For instance, if an ndmapi_sendcmd

 

 

returns with the resp_moreflag set and the cmd_id is not

 

 

SELECT_STATISTICS or SELECT_PROCESS, the CLI

 

 

generates an error.

 

 

 

 

 

 

 

 

data1, data2,

For future expansion. data1 is used with the submit

 

and data3

command to return the Process number. data2 is used

 

 

with the submit command to return the result of the

 

 

Process (0, 4, 8, or 16)

 

 

 

 

 

 

 

 

 

 

 

 

The ndmapi_sendcmd_c() function call has the following return codes:

Return Code

Description

 

 

NDM_NO_ERROR or Process Number

The function completed successfully.

 

 

NDM_ERROR

An error occurred. Consult the error

 

structure for detailed error status.

 

 

Following is a sample ndmapi_sendcmd() function:

int32 rc, resp_moreflag; struct sendcmd_data ret_data; rc=ndmapi_sendcmd (error,

"select process pnumber=2 ;", &resp_moreflag,

&ret_data );

Writing Custom C++ Programs

If you write a custom program using C++ API calls, you must include the class called ConnectDirectSession. The calling program must instantiate ConnectDirectSession and call the send and receive functions. A sample program called sdksample.C is provided. To write a custom C++ program, create a ConnectDirectSession class. The class contains the ConnectDirectSession interface and a constructor and destructor call to allocate and release the storage associated with the class. This class is the interface to the Sterling Connect:Direct methods and provides connection, command, data retrieval, and error services. Each method returns either CD_SUCCESS or CD_FAILURE.

Chapter 4. Writing Custom Programs 69

Image 75
Contents User Guide Page User Guide Copyright IBM Corporation 1999 Contents Iv Sterling ConnectDirect for Unix User Guide Stopping the CLI Overview of the Command Line InterfaceCLI Commands Starting the CLIOption Description Value Entry Sample CommandCdpnum CLI Job ControlCommand Abbreviation Description CLI History CommandsOverview of Sterling ConnectDirect Commands CommandParameter Abbreviation Abbreviations for Common Sterling ConnectDirect CommandsSubmitting a Process Pname = A?PROD5Parameter Description Values Parameter Description Values Id , pswd Username@hostname or user@localhostName nnnnn Name host name nnn.nnn.nnn.nnn orSnodeid field Id ,pswd ,newpswdSpecify retain=initial Following command submits the Process named copyfil Following command submits the Process named payrollName generic list Following command submits the Process named copy.cdpChanging Process Parameters Parameter Description ValueNode specification, userid generic list Remote node specification generic listDeleting a Process from the TCQ Number list Removing a Process from the Execution Queue Stopping Sterling ConnectDirect Flush process command has the following optional parametersParameter Description Viewing a Process in the TCQPname Locate the Process to view EX HC HE HI HO HR HS PE Monitoring Process Status in the TCQ Following command displays the specified Process numberAll EX HC HE HI HO HR HS PE Output from the command is displayed in the following table Dest=/path/file name Determining the Outcome of a ProcessRecord id list Caev Capr CAEV, CaprParameter Description Value Parameter Description Value Parameter Description Value Date day , hhmmss ampm Srcf=/path/file nameGenerating a Detailed Output Report for a Process Recid LOG Timepname Pnumber Stepname Ccod Fdbk Msgid Running System DiagnosticsGenerating a Summary Report for a Process Select StatisticsCOMM.TRC Smgr Trace smgr pnode tnode=ath3500ry level=2 file=Smgp.trc Scheduling Parameter Queue Comments Command DefinitionOverview of the Transmission Control Queue Scheduling Sterling ConnectDirect ActivityProgression of a Process Through the TCQ Execution Queue Wait Queue Element CommentStatus Comment Hold Queue Timer QueueHeld for Call indicates that the Process was Creating a Translation Table Introduction to Translation TablesExample-Creating a Translation Table Compiling a Translation Table Using the ndmxlt UtilityExample-Modifying a Model Translation Table Using Translation During File Transfer OperationsDiagnostic Number Description Translation Table Error MessagesAccessing Sterling ConnectDirect Messages Message File ContentFollowing are the parameters for the message file record Following is a sample ndmmsg commandMessage File Record Format Displaying Message TextSterling ConnectDirect for Unix User Guide Memory-The amount Using the Standalone Batch Compression UtilityFollowing are the parameters for the cdsacomp utility Level-Compression levelSource codepage, destination CodepageNnnnn Example-Decompress a Text File Example-Precompress a Text FileExample-Precompress a Text File With Codepage Conversion Example-Precompress a Binary FileExamples-csdacomp Command Help Argument Description Validate Configuration FilesConfiguration Reports Cfgcheck command has the following argumentsType the following command at a Unix prompt Generating a Configuration Report on the Base InstallationSterling ConnectDirect Utilities Following example shows an excerpt from a sample report Sterling ConnectDirect Utilities Sterling ConnectDirect for Unix User Guide Compiler version to use for each platform Program using the C++ API callsIntroduction to Writing Custom Programs Compiling Custom ProgramsYou want to create such as apicheck Platform Compile Command++ Function Description Writing Custom C ProgramsNdmerrenth Ndmerror NdmnoerrorReceiving Responses Using ndmapirecvresp or ndmapirecvrespc Ndmapirecvresp orNdmapirecvrespc Parameter Description Value PNOD-PNODE Truncated Following is a sample ndmapirecvresp functionSNOD-SNODE Return Code DescriptionNdmapirecvresp or ndmapirecvrespc to retrieve Selectstatistics or Selectprocess , the CLI Writing Custom C++ ProgramsNdmapisendcmdc function call has the following return codes Following is a sample ndmapisendcmd functionSterling ConnectDirect for Unix User Guide Cdfailure Method Description Parameter Return ValuesCdsuccess = 0, Cdfailure = Following is the ConnectDirectSession class headerWriting Custom Programs Sterling ConnectDirect for Unix User Guide Chown root exitskeleton User Exit ProgramsUser Exit Functions Program DescriptionReturn Code Goodrc ErrorrcExitprogram Waiting for a Message Using recvexitmsg or recvexitmsgcHeader Following are the parameters for sendexitmsg or sendexitmsgcOverview of User Exit Messages Statistics Exit MessageFile Open Exit Messages Fileopenoutputreplymsg Security Exit MessagesValidatemsg Validatereplymsg GeneratemsgUser Exit Stop Message Copy Control BlockExit Log Files 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