Transformation Logic

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
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Transformation Logic

Post 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
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Transformation Logic

Post 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.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post 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......
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post 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.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post 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.......
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Show us some values, including one for R.

Also please advise what data types are involved.
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