Build op - Float comparison.

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
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Build op - Float comparison.

Post by bikan »

generation of build op fails for incorrect operator =='
If condition with == works fine for all string constants but fails for decimal constants.

Here is the code

Code definition.
==============
char BLOCKA=' ';
char BLOCKB=' ';
==============

code - Per records
=======================
doTransfer(0);
BLOCKA = ' ';
BLOCKB = ' ';

if (CHD_EXTERNAL_STATUS == 'B')
{
BLOCKA = 'B';
BLOCKB = 'H';
}
else if (CHD_STATUS_REASON_CODE = 89)
#==> Here is where it fail, the data is decimal and is defined decimal in metadata;

{
BLOCKA = 'Z';
BLOCKB = 'H';

}
writeRecord(0);

==============================

Error Message:

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/BlkCode.opd

##E TBLD 000000 Subprocess command failed with exit status 256.
##W TBLD 000000 Output from subprocess: "Per-Record Code (buildop/BlkCode.opd)", line 25.33: 1540-0218 (S) The call does not match any parameter list for "operator=".

##I TBLD 000000 /usr/vacpp/bin/xlC_r -O -I/data/ds/ccs/projectlibs/dpr_ccs_dev/buildop -I/opt/tools/ds/Ascential/DataStage/PXEngine/include -O -c -qspill=32704 /data/ds/ccs/projectlibs/dpr_ccs_dev/buildop/bosource1151424-0.C -o /data/ds/tmp/bosource1151424-0_s.o.
##W TBLD 000000 Output from subprocess: "/opt/tools/ds/Ascential/DataStage/PXEngine/include/apt_util/decimal.h", line 317.16: 1540-1283 (I) "APT_Decimal::operator=(const APT_Decimal &)" is not a viable candidate.
"Per-Record Code (buildop/BlkCode.opd)", line 25.10: 1540-1289 (I) The implicit object parameter of type "APT_Decimal &" cannot be initialized with an implied argument of type "const APT_Decimal".
"/opt/tools/ds/Ascential/DataStage/PXEngine/include/apt_util/decimal.h", line 300.16: 1540-1283 (I) "APT_Decimal::operator=(APT_DFloat)" is no
##W TBLD 000000 Output from subprocess: t a viable candidate.

##W TBLD 000000 Output from subprocess: "Per-Record Code (buildop/BlkCode.opd)", line 25.10: 1540-1289 (I) The implicit object parameter of type "APT_Decimal &" cannot be initialized with an implied argument of type "const APT_Decimal".
====================================

Thanks
bikan
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

For a check you need two equal signs. You have only one ("else if (CHD_STATUS_REASON_CODE = 89)")
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Post by bikan »

I have == it was not working too. I made mistake while writing post.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Do me a favour, dont type your code out, copy paste it from the buildop. This way we can see the actual code and compare it to the error message. Also surround your code in code tags please.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Post by bikan »

Here You Go...

===================================
Code definition.
==============
char BLOCKA=' ';
char BLOCKB=' ';
==============

code - Per records
=======================
doTransfer(0);
BLOCKA = ' ';
BLOCKB = ' ';

if (CHD_EXTERNAL_STATUS == 'B')
{
BLOCKA = 'B';
BLOCKB = 'H';
}
else if (CHD_STATUS_REASON_CODE == 89)
#==> Here is where it fail, the data is decimal and is defined decimal in metadata;

{
BLOCKA = 'Z';
BLOCKB = 'H';

}
writeRecord(0);
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I am not that experience in BuildOps, I go for routines. But instead of comparing with 89, specify a const float and initialize it with 89. Do your comparison with that variable. Also before you try that, try changing your data type to float and then run your code, unchanged, and see if the error persists. If it does, try the first suggestion I gave.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

To what object does CHD_EXTERNAL_STATUS belong? Where have you declared this?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply