Page 1 of 1

Transformation Logic

Posted: Wed Apr 09, 2008 7:45 am
by prasson_ibm
HI,
I am taking input from flat file. It has three column
These are:-
COL NAME DataType
DATE1 VARCHAR
DATE VARCHAR
DATE1 Contains Input as d/m/yyyy
DATE Contains input as d/m/yyyy
In Transformation i m applying this Logic:-
Stage Variable Name
A=Field(InputLink.BILL_DATE1, "/",1)
B=Field(InputLink.BILL_DATE1, "/",2)
C=Field(InputLink.BILL_DATE1, "/",3)
X=Field(InputLink.BILL_DATE, "/",1)
Y=Field(InputLink.BILL_DATE, "/",2)
Z=Field(InputLink.BILL_DATE, "/",3)
and
R=X-Y
But i m not getting proper output
Please help me .....
Thanks

Re: Transformation Logic

Posted: Wed Apr 09, 2008 7:51 am
by sud
The value of R will be the numeric difference between the date and month numbers of the second date field (BILL_DATE). Can you please explain what output you need beacuse the derivation R = X - Y carries no sense.

Posted: Wed Apr 09, 2008 11:31 pm
by prasson_ibm
Hi,

I am very sorry,it is
R=X-A
and target is sequencial file
Here i m getting 0 insted of some numaric values......

Posted: Thu Apr 10, 2008 12:02 am
by ray.wurlod
Add an extra output link, send your stage variables to it, and see whether your Field() functions are working as you anticipated.

Posted: Thu Apr 10, 2008 12:53 am
by ShaneMuir
Also check what the format of your stage variables is set at. If you placing the value of the stage variable R into a char field with only a length of 2 but your variable has been set up as decimal 5 you might be only seeing the first leading zeros or something.

Posted: Thu Apr 10, 2008 2:14 am
by prasson_ibm
Hi Ray,
Ya i have checked the output of Field() function with extra output link and its working fine.................................but still my output is not correct.......

Posted: Thu Apr 10, 2008 2:19 am
by ray.wurlod
Show us some values, including one for R.

Also please advise what data types are involved.