Buildop C++

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Buildop C++

Post by Kirtikumar »

Hi All,

I want to abort the job in Buildop C++ Stage / PX Tansformer with customize warning message.
I am using DSLogFatal for the same.
But I am getting following error
"DSLogFatal" is not declared.

Do I need to include any C++ API file for this purpose?

Thanks in advance

Cheers,
Vinayak
Regards,
S. Kirtikumar.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DSLogFatal is a BASIC function.

In the DataStage C API there is a function called ds_writelog()
It's prototype is in dsd_gci.h and an example of its use is in dscapi.h, both of which can be found in $DSHOME/gcidir/include on the server.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

Post by benny.lbs »

Ray,

How to include this Header file (*.h) into BuildOp ?

I code as following

Code: Select all

#ifndef DSD_GCI_H
#ifndef DATUM
#define DATUM long
#define DBFILE long
#define HANDLE long
/* #define BITMAP long */
typedef struct tagSTRING
{ 
    unsigned int len;
    unsigned char* text;
} STRING;
#endif /* DATUM */
#define h_typedef

#ifdef WIN32
#include "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/UCI.h"
#else
#if !defined(_AIX) && !defined(__alpha)
#include "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/UCI.h"
#endif
#endif

struct SHdata {int i;};
#include "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h"
#endif /* DSD_GCI_H */
but failed with
Operator Generation Failed

buildop -f -BC /usr/vacpp/bin/xlC_r -BL /usr/vacpp/bin/xlC_r -C buildop -H buildop -O buildop -W buildop buildop/WriteLog.opd

##E TBLD 000000 Subprocess command failed with exit status 256
##W TBLD 000000 Output from subprocess: 1540-5215 (I) No licenses available. Contact your program supplier to add additional users. Compilation will proceed shortly.
##I TBLD 000008 /usr/vacpp/bin/xlC_r -O -I/sysp/DataStage/Ascential/Projects/ZEDPLBS/buildop -I/sysp/DataStage/Ascential/DataStage/PXEngine/include -O -c -qspill=32704 /sysp/DataStage/Ascential/Projects/ZEDPLBS/buildop/bosource232334-0.C -o /hsbc/gcf/tmp/bosource232334-0_s.o
##W TBLD 000000 Output from subprocess:

##W TBLD 000000 Output from subprocess: "File Scope Code (buildop/WriteLog.opd)", line 18.3: 1540-0400 (S) "STRING" has a conflicting declaration.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/Projects/ZEDPLBS/buildop/bosource232334-0.C", line 36.20: 1540-0425 (I) "STRING" is defined on line 36 of "/sysp/DataStage/Ascential/Projects/ZEDPLBS/buildop/bosource232334-0.C".

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1114.25: 1540-1136 (S) "STRING d_str" cannot be a union member, because "APT_String" has a non-trivial constructor.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1122.25: 1540-0040 (S) The text "col1" is unexpected. "COLDATA" may be undeclared or ambiguous.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1265.20: 1540-1136 (S) "ANYPINDATA anypin" cannot be a union member, because "anypin_data_tag" has a non-trivial constructor.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1310.19: 1540-0040 (S) The text "pin_data" is unexpected. "LPPINDATA" may be undeclared or ambiguous.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1314.19: 1540-0040 (S) The text "stagedata" is unexpected. "STAGEDATA" may be undeclared or ambiguous.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1431.38: 1540-0040 (S) The text "ppin" is unexpected. "LPPINDATA" may be undeclared or ambiguous.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1432.38: 1540-0040 (S) The text "ppin" is unexpected. "LPPINDATA" may be undeclared or ambiguous.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1433.40: 1540-0040 (S) The text "ppin" is unexpected. "LPPINDATA" may be undeclared or ambiguous.

##W TBLD 000000 Output from subprocess: "/sysp/DataStage/Ascential/DataStage/DSEngine/gcidir/include/dsd_gci.h", line 1434.43: 1540-0040 (S) The text "ppin" is unexpected. "LPPINDATA" may be undeclared or ambiguous.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There's other stuff in dsd_gci.h that needs a licence. Try creating your own header file just incorporating the relevant prototype. Apart from that, it's not something I've done, so I await the results of your experiment; any additional advice will be purely theoretical. Has your support provider suggested anything?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
alraaayeq
Participant
Posts: 35
Joined: Sun Apr 04, 2004 5:57 am
Location: Riyadh,Saudi Arabia

Post by alraaayeq »

Kirtikumar,

I have a follow up question (if you dont mind).

what sort of C++ compiler do you have, and have you tried GCC before?
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

Re: Buildop C++

Post by benny.lbs »

Kirtikumar,

Have you solved this problem ?

Ray,

There is Macro APT_MSG in "PXEngine/include/apt_util/message.h", do you know how to use it ?

APT_MSG(MessageSeverity, englishString, args, logOrSourceModule)

For "logOrSourceModule", what is the possible value ?

Thanks all of you.
evandal
Participant
Posts: 10
Joined: Wed Nov 08, 2006 12:03 pm
Location: Montreal,QC

Re: Buildop C++

Post by evandal »

benny.lbs wrote:APT_MSG(MessageSeverity, englishString, args, logOrSourceModule)

For "logOrSourceModule", what is the possible value ?
Hi, I know this is an old thread, but I can't find any documentation on what "logOrSourceModule" should be. If I set it to APT_LogWarningId (generated by the builOp code), I get a message "Resource bundle corresponding to message key This is a warning message! Check that DSHOME or APT_RESPATH is set." in my job log. So I assume that this is some sort of link to a resource file with pre-defined messages.

I also tried NULL, but it defaults to the same ting. What should the value of "logOrSourceModule" be if I just want to pass a string to APT_MSG and have that displayed in the log. Sample or explanation would be much apreciated!
Eric Vandal - CGI
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hopefully this helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
evandal
Participant
Posts: 10
Joined: Wed Nov 08, 2006 12:03 pm
Location: Montreal,QC

Post by evandal »

Hi, Thanks for the quick reply. The link doesn't work but I assume it is this one
http://www-01.ibm.com/support/knowledge ... acros.html

All that says is:
The final argument is logOrSourceModule : the object to which the message is written.
The argument value can be an APT_ErrorLog object, an APT_Error::SourceModule object, or it can be NULL. If the value is NULL, the message is written to the APT_Error::SourceModule object APT_localErrorSourceModule.
I assume that what I am passing is a "APT_Error::SourceModule object" and that doesn't work because of the whole resource issue mentioned above.

So what is an "APT_ErrorLog object"? Is there a function to convert an EnglishString as they refer to it to an APT_ErrorLog Object?

If you take the example from that page, that doesn't even compile.
APT_MSG(Error, "The number of output datasets is invalid.", NULL, errorLog);
So that IBM page isn't a lot of help. I'm not really strong in C but I have been looking at the message.h and errlog.h files to try to figure out what they expect for this parameter.

Does anyone have an actual working example of this code?

Appreciate all your help.
Eric Vandal - CGI
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hmmm... the link I posted worked (and still works) fine for me. Looks like you found the same information, however.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply