Compare the two dates which is Greater

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
boppanakrishna
Participant
Posts: 106
Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai

Compare the two dates which is Greater

Post by boppanakrishna »

hi all,
I have two source files , one is main source which contains columns like "sno","Date",and the other file contains only one column "ADate",
now i want to compare the "Date " column from first source with the "ADate" , and if the Date of " Date" column in first file is greater than the date of "Adate " then only i should pass it into the target ...


Thanks in Advance
Boppana Krishna
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are several ways to solve this. Do you have any ideas about how you wish to proceed? For example, is the comparison to be performed row by row?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
boppanakrishna
Participant
Posts: 106
Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai

Post by boppanakrishna »

hi Ray,
My second Dataset contains only one Date and based upon that date only i should pass the values to the target ,could you please tell me the stages to use also

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

Post by Kirtikumar »

What do you mean by based upon that date?

Does this mean - if the Date coming from second dataset is null then pass it or if it is equal to current date then pass it?

It is diff to get anything from the what you are saying. Can you please mention what is your condition on which record should be passed to target :?:
Regards,
S. Kirtikumar.
boppanakrishna
Participant
Posts: 106
Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai

Post by boppanakrishna »

hi keerthi,
i will pass only the dates which are greater of the two dates to the target

Thanks
Boppana Ramakrishna
dsdev750
Charter Member
Charter Member
Posts: 16
Joined: Sat Jun 04, 2005 10:19 am

Post by dsdev750 »

In the first job, you could read the dataset first and pass the date to a second job as a job parameter(vDateParam). In the second job, use a transformer and a constraint to only let those records through where incoming date is > vDateParam.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Make sure your dates are in an ISO format, then a simple compare will work: YYYY-MM-DD or YYYYMMDD, for example.
-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 »

You can do it in one job. Perform the full outer join, then use a downstream Filter stage to constrain the rows passed through. I needed to be certain of what you needed to do.
Last edited by ray.wurlod on Thu Oct 12, 2006 2:46 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

Post by ambasta »

I think you can do this by converting your fields as datetosting or timestamptoString and then compare themn.I think this will work
ambasta
Post Reply