no errors, no warnings, but logic doesnot works

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

no errors, no warnings, but logic doesnot works

Post by pxraja »

Hi all,

I am using stage variables, to get the updated fields alone , i.e,
I am having 3 fields of which one field is primary key

Inlink.Field1, Inlink.Field2, Inlink.Field3
Mar 08 465155 'akjdfkjfd'
Jun 08 645553 'djkfdkafj'
Feb 08 464885 'hdahdgfd'

Outlink.Field1, Outlink.Field2, Outlink.Field3
Feb 08 464885 'hdahdgfd'
Mar 08 465155 'akjdfkjfd'

these are the records already in Oracle table, now I want to pass updated record, i.e

Outlink.Field1, Outlink.Field2, Outlink.Field3
Feb 08 464885 'hdahdgfd'
Mar 08 465155 'akjdfkjfd'
Jun 08 645553 'djkfdkafj'

to get this i am using the stage variables, like
DSLink30.Field1 -------> RefCmon
DATE.TAG(Iconv(Lnk_Src_Trf.Field,'D MY[A3,2]'))---->InCmon
If InCMon > RefCMon Then '1' Else '0' ------>AllowCMon

I don't get any any errors, but no rows were written to output

0000000 Lkup
0000000 |
0000000 |
ODBC--->TRF -------->ODBC

i am using the constraint, Dslink20.field1 from Lkup(hash file) it has the value '2008-03-01' (only this record) and the constraint used is
AllowCmon='Y'

Field1 is the primarykey

No rows were written to the output ODBC,
LkUp is done on the transformer. I had checked the conditions and logs no errors or warnings are found.

plz any one suggest some ideas

thanks in advance
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Use the debugger to determine what is wrong with your constraint such that it doesn't allow any rows to pass through it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

Hi all,

I used debugger but I could not able to point out where the problem is..

after I tried with different constraints

one of them is

Oconv(Iconv(Inlink.Field1,'D MY[A3,2]'),'D-YMD')= LkUplink.Field1

where Inlink.Field1 has 'Mar 08' i am converting it to 2008-03-01
and LkUplink.Field1 has 2008-03-01

Inlink.Field1 is mapped to Outlink.Field1, while executing no rows were written to Outlink.Field1... also no warnings, or no errors

how to find where I am wrong.
any suggestions will help me to resolve this issue

thanks in advance

whether anywhere i am wrong
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Put your expression in a 'test harness' (a small routine) then test to ensure you are getting what you think you are getting from it:

Code: Select all

Ans=Oconv(Iconv(Arg1,'D MY[A3,2]'),'D-YMD')
-craig

"You can never have too many knives" -- Logan Nine Fingers
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

Hi all,

I want to know whether the conversion of the field in constraint will work or not.

because if i am directly mapping the Inlink.Field1=Lkuplink.Field1 its working. then why conversion not working?
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

Hi all,

I want to know whether the conversion of the field in constraint will work or not.

because if i am directly mapping the Inlink.Field1=Lkuplink.Field1 its working. then why conversion not working?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

pxraja wrote:I want to know whether the conversion of the field in constraint will work or not.
If done properly, sure.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Put your expression in a 'test harness' (a small routine) then test to ensure you are getting what you think you are getting from it, as Craig suggested. This is how you find out whether it will work or not.

The Routine editor has its own, inbuilt, test utility.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

or my doubt is whether DATE field can be equated or not, if yes

how can get the rows greater than the particular date

eg: Inlink.Field1 Inlink.Field2 Inlink.Field3
2008-03-01 hafjkdhk djflsdkf
2008-02-01 gijdjgdkl kkdfds
2008-05-01 adfklsdf kfdslfds

In look up hash file, I am getting the date in Lkuplink.Field1 as 2008-03-01 alone

I want to insert into the ouput link only the last row since the first two rows are there, Field1 and Field2 are key columns

I am using the constraint like

Inlink.Field1 = Lkuplink.field1

but no rows are inserted into the target

Outlink.Field1 Outlink.Field2 Outlink.Field3
2008-03-01 hafjkdhk djflsdkf
2008-02-01 gijdjgdkl kkdfds

I could not able to find by debugger or by implementing the constraint, if i am using other constraint on different field its working.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The "dates", which are actually strings, can be compared. What dates exist in the hashed file? Are the dates on both inputs identically trimmed and formatted?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

chulett wrote:Put your expression in a 'test harness' (a small routine) then test to ensure you are getting what you think you are getting from it:

Code: Select all

Ans=Oconv(Iconv(Arg1,'D MY[A3,2]'),'D-YMD')
I have checked the above expression, it's working fine. Its giving output as expected i.e 2008-03-01

I am also getting this in hash file as it is, i.e 2008-03-01

and then I use this hashfiel as a lookup and trying to get all the rows having the greater value than Lkuplink.Field1

but no rows were written, I am wondering why this happens, no errors, or warnings..
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

yep,

its been identical. even i modified the query to get only the month. i.e like

Oconv(Iconv(Inlink.Field1,'D MY[A3,2]'),'D M[2]')

its output came as
03
02
05

and same modification in lookup also

Oconv(Iconv(Lkuplink.Field1,'D MY[A3,2]'),'D M[2]')

output as

03

even then the comparision doesnot work
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

If I am comparing the dates as it is, i.e 'Mar 08' , its returning the values like alphabetical order comparision.

i.e., for the logic Inlink.Field1< Lkuplink.Field1

where Inlink.Field1 has values like('Jan 08','Feb 08','Mar 08','Apr 08','May 08','Jun 08')

and Lkuplink.Field1 has 'Mar 08'

but the rows were written, whose Inlink.Field1 having ('Jan 08','Feb 08','Mar 08','Apr 08','Jun 08')

only 'May 08' records are omited

but it should not be the output expected...

expected output for the above condition should have 'Jan 08','Feb 08' records alone.
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

thanks ray and chulett

I had designed the new job, its working for the same constraint

hope I can now guess these things

in Hash file I had only one value so that I can equate to that value only.
secondly, I had made some of the fields wrongly mapped

thanks for your patience and suggestions
Post Reply