Note: The environment variable NDMAPICFG must be set to the pathname of the client configuration file. Refer to “Starting the CLI” on page 1for instructions on setting the environment variable.
To use the ConnectDirectSession class, your application must include the cdunxsdk.h header file provided in the installation and must link with the ndmapi.a file. Following is a sample ConnectDirectSession class program:
#include "cdunxsdk.h" #include <iostream.h> #include <string.h>
void getError(ConnectDirectSession& cdSess); main()
{
ConnectDirectSession cdSess; char processText[16384];
if
{
strcpy(processText,"submit maxdelay=unlimited sdksample process snode=SNODENAME "); strcat(processText,"copy00 copy from (file=sample.txt pnode)");
strcat(processText,"to (file=sample.000 snode disp=rpl) ;"); if
{
printf("%s completed, pnumber = %ld.\n",
sprintf(processText, "SELECT STATISTICS PNUMBER=%ld DETAIL=YES ;", cdSess.SessionINF- >GetProcessNumber());
{
}
else
{
getError(cdSess);
}
}
else
{
getError(cdSess);
}
}
else
{
getError(cdSess);
}
}
void getError(ConnectDirectSession& cdSess)
{
if
{
printf("\nError Message: | %s", |
| |
printf("\nError Feedback: | %d", |
| |
printf("\nError RC: | %d", |
| |
printf("\nError SUBST: | %s\n", | } | |
|
| ||
{ |
|
|
|
printf("\nError Message: | %s", |
| |
printf("\nError Feedback: | %d", |
| |
printf("\nError RC: | %d", |
| |
printf("\nError SUBST: | %s\n", |
| |
} |
|
|
|
}
The ConnectDirectSession class methods are described in the following table: