Date compare not working

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gauravb
Participant
Posts: 14
Joined: Tue Nov 30, 2004 7:25 am
Location: India
Contact:

Date compare not working

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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).
jayawant_hsbc
Participant
Posts: 7
Joined: Wed Jan 05, 2005 11:05 pm

Post 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
Post Reply