Page 1 of 1

DaysSinceFromDate function

Posted: Wed Aug 17, 2005 1:31 pm
by studyguy2001
Hello.,

problem: i have a column with data type integer. it has to be converted into date and then again the date has to be converted into interger in the output.

i know there is a function in datastage DaysSinceFromDate . this function can ve used to do it.


does anyone has used this function before. if yes then please provide me a sample code.

otherwise does anyone please help me in solving my problem. i have to do that in a parallel extender transformer.

thanks
mark

Posted: Wed Aug 17, 2005 2:30 pm
by ArndW
Mark,

converting an Integer date (in Julian date format?) to a date and back to an integer should give the same result. The conversion between types needs to know the source and target formats, otherwise it won't work correctly. Do you know your source date format in integer? Why do you need to convert it? The DaysSinceFromDate works well, I have used it before without problems.

Hello

Posted: Wed Aug 17, 2005 3:07 pm
by studyguy2001
ArndW wrote:Mark,

converting an Integer date (in Julian date format?) to a date and back to an integer should give the same result. The conversion between types needs to know the source and target formats, otherwise it won't work correctly. Do you know your source date format in integer? Why do you need to convert it? The DaysSinceFromDate works well, I have used it before without problems.

my requirement is it use only the DaysSinceFromDate function. i need to use this to implement the business logic.
the source date format is in int32 and the target date format is also in int32.
the business flow ( as decided by BA) the function has to be used in parallel extender trasnformer.in this transformer i have write all my logic of converting the int32 to date and again back to int32 in output.

i sincerely thank you for your reply. And i look farwarrd for your reply

MARK

Posted: Wed Aug 17, 2005 4:34 pm
by ray.wurlod
my requirement is it use only the DaysSinceFromDate function
Who made that a requirement?
There is usually more than one way to achieve a result in DataStage, being forced to use one method may prevent your finding more efficient techniques.

Neither did you tell us what the integer represents. Is it the date, such as 20050818, or is it an integer number of days since some arbitrary day zero?