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
Date compare not working
Moderators: chulett, rschirm, roy
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).
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).
-
- Participant
- Posts: 7
- Joined: Wed Jan 05, 2005 11:05 pm