Page 1 of 1

Date compare not working

Posted: Sun Jan 09, 2005 6:43 am
by gauravb
Hi Friends.

I need to apply a constraint in the transformer ex:-
So the booking date should be equal to current date
So this is what I did
OCONV(booking.date, "D2/") = OCONV(@DATE, "D2/")
Why is this not working? ( booking .date is in Julian ) , when I print both of these values they give “4/1/04’ and 9/1/05’ which is correct

Posted: Sun Jan 09, 2005 7:36 am
by ArndW
Hello Gauravb,

DataStage stores dates internally as number of days since 31/12/1967. Most "Julian Dates" that I've seen start their counting in the Year 0000. In your case, if the "Booking.Date" is already in DataStage internal format you do not need to perform Date "OCONV"s at all. But since your constraint is not working I assume that your Booking.Date is ?NOT in the correct internal format. Where is this date coming from or how are you generating it? You can using the DS-Designer debugger to print out the (non-OCONV'd) numeric value so that you can find the cause of your problems.

Also, the constraint has to map to "TRUE", so the code you pasted will only pass rows where the booking.date is that of the date the job run starts (@DATE won't change when going to the next day).

Posted: Sun Jan 09, 2005 10:56 pm
by jayawant_hsbc
hi gaurav b . my experience says that when ever you figit with date use iconv to convert into internal date format , it will generate a internal no. then u can convert into any format and use it anyhow u want
for syntax u can go to help and see