IBM 4J manual Ndmapirecvresp or ndmapirecvrespc to retrieve

Page 74

Sending a Command to Sterling Connect:Direct Using ndmapi_sendcmd() or ndmapi_sendcmd_c()

Use ndmapi_sendcmd() or ndmapi_sendcmd_c() to allow a command to be sent to a Sterling Connect:Direct application. Following is the format of ndmapi_sendcmd() or ndmapi_sendcmd_c():

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

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

&ret_data );

Following are the parameters for ndmapi_sendcmd() or ndmapi_sendcmd_c():

Parameter

Description

Value

 

 

 

error

A pointer to a Sterling Connect:Direct-defined structure

Pointer

 

that contains error information or status information.

 

 

 

 

cmd_text

A pointer to the null-terminated text string that specifies

Pointer to a text

 

the command to send to Sterling Connect:Direct. The

string

 

command text must be followed by a semicolon and

 

 

terminated with a null.

 

 

When you use the submit=filename command from the

 

 

API, ensure that you allocate enough storage for the

 

 

Process text. The text of the Process submitted is

 

 

returned in the text string associated with this parameter

 

 

when the function completes. If you do not allocate

 

 

enough storage for the Process text, a core dump can

 

 

result.

 

 

 

 

resp_moreflag

A pointer to the flag that indicates that more responses

Pointer to a flag

 

are pending for the command just executed. Invoke

 

 

ndmapi_recvresp() or ndmapi_recvresp_c() to retrieve

 

 

the extra responses.

 

 

 

 

ret_data

A pointer to a structure containing internal response

Pointer to a

 

information for a command. The structure is:

structure

 

struct sendcmd_data {

 

 

char * cmd_name;

 

 

ulong cmd_id;

 

 

long data1;

 

 

long data2;

 

 

long data3;

 

 

};

 

 

 

 

sendcmd_data

Provides the caller with some information about the user

Information

 

request. Because parsing of command text occurs at the

about the user

 

CMGR, the End User Application (EUA) has no way to

request

 

identify the command that was submitted, unless it

 

 

generated the text.

 

 

 

 

cmd_name

A pointer to a string with the name of the command

Pointer to name

 

submitted. The CLI uses this pointer to display

of command

 

completion messages. This field enables you to display

 

 

unique completion messages without any knowledge of

 

 

a specific command in the EUA.

 

 

 

 

68Sterling Connect:Direct for UNIX: User Guide

Image 74
Contents User Guide Page User Guide Copyright IBM Corporation 1999 Contents Iv Sterling ConnectDirect for Unix User Guide Starting the CLI Overview of the Command Line InterfaceCLI Commands Stopping the CLISample Command Option Description Value EntryCLI Job Control CdpnumCommand CLI History CommandsOverview of Sterling ConnectDirect Commands 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 copyfilParameter Description Value Following command submits the Process named copy.cdpChanging Process Parameters 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 Select Statistics Running System DiagnosticsGenerating a Summary Report for a Process Recid LOG Timepname Pnumber Stepname Ccod Fdbk MsgidCOMM.TRC Smgr Trace smgr pnode tnode=ath3500ry level=2 file=Smgp.trc Scheduling Sterling ConnectDirect Activity Command DefinitionOverview of the Transmission Control Queue 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 TableMessage File Content Translation Table Error MessagesAccessing Sterling ConnectDirect Messages Diagnostic Number DescriptionDisplaying Message Text Following is a sample ndmmsg commandMessage File Record Format Following are the parameters for the message file recordSterling ConnectDirect for Unix User Guide Level-Compression level Using the Standalone Batch Compression UtilityFollowing are the parameters for the cdsacomp utility Memory-The amountNnnnn Source codepage, destinationCodepage Example-Precompress a Binary File Example-Precompress a Text FileExample-Precompress a Text File With Codepage Conversion Example-Decompress a Text FileExamples-csdacomp Command Help Cfgcheck command has the following arguments Validate Configuration FilesConfiguration Reports 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 Compiling Custom Programs Program using the C++ API callsIntroduction to Writing 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 Return Code Description Following is a sample ndmapirecvresp functionSNOD-SNODE TruncatedNdmapirecvresp or ndmapirecvrespc to retrieve Following is a sample ndmapisendcmd function Writing Custom C++ ProgramsNdmapisendcmdc function call has the following return codes 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 Program Description User Exit ProgramsUser Exit Functions 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