Error in getting statistics using DSGetLinkInfo
Posted: Mon Sep 22, 2008 1:40 pm
I am trying to find the link statistics from a particular link in a Job. I am using a parallel routine to get the link statistics but getting the following error :
Update_Audit: Failed to load the library "V0S128_RXDWW06L_RouTest_Update_Audit.so"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S128_RXDWW06L_RouTest_Update_Audit": /opt/IBM/InformationServer/Server/Projects/LCDW/RT_BP245.O/V0S128_RXDWW06L_RouTest_Update_Audit.so: undefined symbol: DSGetLinkInfo.
I compiled the routine in the same system on which DataStage is running with the same compiler options. I also tried this on another Linux server with DataStage Version 7.5.2 but getting the same error as above.
Could someone please help me resolve this. We already opened a ticket with our service provider couple of weeks back.
The following is the c++ Code in the Routine :
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <ctype.h>
# include <stdlib.h>
#include <string.h>
#include<unistd.h>
#include "/opt/IBM/InformationServer/Server/DSEngine/include/dsapi.h"
#ifndef BOOL
#define BOOL int
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define DSJE_DSJOB_ERROR -9999
/*****************************************************************************/
/*
* Handle the -linkinfo sub-command
*/
int jobLinkInfo(int argc, char* Proj, char* jobnm, char* Stagenm, char* linknm)
{
DSPROJECT hProject;
DSJOB hJob;
int status;
char *project;
char *job;
char *stage;
char *link;
DSLINKINFO linkInfo;
project = Proj;
job = jobnm;
stage = Stagenm;
link = linknm;
/* Attempt to open the project and the job */
if ((hProject = DSOpenProject(project)) == NULL)
{
status = DSGetLastError();
fprintf(stderr, "ERROR: Failed to open project\n");
}
else
{
if ((hJob = DSOpenJob(hProject, job)) == NULL)
{
status = DSGetLastError();
fprintf(stderr, "ERROR: Failed to open job\n");
}
else
{
/* Try getting all the link info */
status = DSGetLinkInfo(hJob, stage, link, DSJ_LINKROWCOUNT, &linkInfo);
if (status != DSJE_NOERROR)
fprintf(stderr, "Error %d getting link row count\n", status);
else
printf("Link Row Count\t: %d\n", linkInfo.info.rowCount);
status = DSGetLinkInfo(hJob, stage, link, DSJ_LINKLASTERR, &linkInfo);
if (status == DSJE_NOT_AVAILABLE)
{
printf("Link Last Error\t: <none>\n");
status = DSJE_NOERROR;
}
else if (status != DSJE_NOERROR)
fprintf(stderr, "Error %d getting link last error\n", status);
else
{
printf("Link Last Error\t:\n");
/*printLogDetail(1, &(linkInfo.info.lastError));*/
}
(void) DSCloseJob(hJob);
}
(void) DSCloseProject(hProject);
}
return status;
}
/*****************************************************************************/
Update_Audit: Failed to load the library "V0S128_RXDWW06L_RouTest_Update_Audit.so"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S128_RXDWW06L_RouTest_Update_Audit": /opt/IBM/InformationServer/Server/Projects/LCDW/RT_BP245.O/V0S128_RXDWW06L_RouTest_Update_Audit.so: undefined symbol: DSGetLinkInfo.
I compiled the routine in the same system on which DataStage is running with the same compiler options. I also tried this on another Linux server with DataStage Version 7.5.2 but getting the same error as above.
Could someone please help me resolve this. We already opened a ticket with our service provider couple of weeks back.
The following is the c++ Code in the Routine :
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <ctype.h>
# include <stdlib.h>
#include <string.h>
#include<unistd.h>
#include "/opt/IBM/InformationServer/Server/DSEngine/include/dsapi.h"
#ifndef BOOL
#define BOOL int
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define DSJE_DSJOB_ERROR -9999
/*****************************************************************************/
/*
* Handle the -linkinfo sub-command
*/
int jobLinkInfo(int argc, char* Proj, char* jobnm, char* Stagenm, char* linknm)
{
DSPROJECT hProject;
DSJOB hJob;
int status;
char *project;
char *job;
char *stage;
char *link;
DSLINKINFO linkInfo;
project = Proj;
job = jobnm;
stage = Stagenm;
link = linknm;
/* Attempt to open the project and the job */
if ((hProject = DSOpenProject(project)) == NULL)
{
status = DSGetLastError();
fprintf(stderr, "ERROR: Failed to open project\n");
}
else
{
if ((hJob = DSOpenJob(hProject, job)) == NULL)
{
status = DSGetLastError();
fprintf(stderr, "ERROR: Failed to open job\n");
}
else
{
/* Try getting all the link info */
status = DSGetLinkInfo(hJob, stage, link, DSJ_LINKROWCOUNT, &linkInfo);
if (status != DSJE_NOERROR)
fprintf(stderr, "Error %d getting link row count\n", status);
else
printf("Link Row Count\t: %d\n", linkInfo.info.rowCount);
status = DSGetLinkInfo(hJob, stage, link, DSJ_LINKLASTERR, &linkInfo);
if (status == DSJE_NOT_AVAILABLE)
{
printf("Link Last Error\t: <none>\n");
status = DSJE_NOERROR;
}
else if (status != DSJE_NOERROR)
fprintf(stderr, "Error %d getting link last error\n", status);
else
{
printf("Link Last Error\t:\n");
/*printLogDetail(1, &(linkInfo.info.lastError));*/
}
(void) DSCloseJob(hJob);
}
(void) DSCloseProject(hProject);
}
return status;
}
/*****************************************************************************/