Page 1 of 1

Modify Stage- DaysSinceFromDate syntax

Posted: Sat Feb 17, 2007 12:53 pm
by venkat_kp
I am trying to count the of days between the Transaction date and the date posted. What is the correct syntax for the modify stage.


NumofDays = DaysSinceFromDate (DatePosted,TransDate)

Thanks.

Posted: Sat Feb 17, 2007 2:29 pm
by ray.wurlod

Code: Select all

NumDays:integer=days_since_from_date[source_date](date)
DaysSinceFromDate() is a Transformer stage function, not a Modify stage function.

Posted: Tue Mar 20, 2007 12:23 pm
by luie
Does the source_date argument of days_since_from_date function accept only hard-coded value? I want to use it but when I pass a date column for source_date, I get the following error. It works though if I use a hard-coded date like "2007-01-01" but this is not the way I want it.

NEW_DATE and TRANSACTION_DATE are my arguments which are both date columns.

-------------------------------------------------------------------------
main_program: Error parsing modify adapter: Error in binding: Parsing parameters "NEW_DATE" for conversion "int32=days_since_from_date[**********](date)": APT_Conversion_DaysSince_Date: Invalid Date [NEW_DATE] used for days_since_from_date type conversion
Expected destination field selector, got: ")"; input:
DIFF = days_since_from_date[NEW_DATE] (TRANSACTION_DATE)
;
[sil/step_il.C:3446]

Posted: Tue Mar 20, 2007 6:14 pm
by ray.wurlod
In Modify stage functions can take only one argument.

In days_since_from_date() the source date must be a constant. It can not be an input column.

Re: Modify Stage- DaysSinceFromDate syntax

Posted: Tue Mar 20, 2007 10:20 pm
by ag_ram
venkat_kp wrote:I am trying to count the of days between the Transaction date and the date posted. What is the correct syntax for the modify stage.


NumofDays = DaysSinceFromDate (DatePosted,TransDate)

Thanks.
if you are looking for the transformer function , here is a sample of how to use that
DaysSinceFromDate(Inputcol.EffDate, DateToString(CurrentDate(),"%yyyy-%mm-%dd"))

Posted: Tue Mar 20, 2007 10:32 pm
by ray.wurlod
Given the original request
venkat_kp wrote:What is the correct syntax for the modify stage.
I do not believe the OP was looking for the Transformer stage function.

Posted: Wed Mar 21, 2007 10:17 am
by gbusson
this founction exist in a modify stage. In the modify, the 2nd parameter must be a constant, not in the transformer.

In the transformer, if the 2nd paramter is not a constant, performance is very poor!

Posted: Wed Mar 21, 2007 10:29 am
by DSguru2B
gbusson wrote: In the transformer, if the 2nd paramter is not a constant, performance is very poor!
The performance has been drastically improved in all 7.x versions. Hence you cannot claim that transformer is "very poor" in performance, unless your using a version lower than 7.x. It still cannot beat modify stage, so I have heard, but its come a long way.

Posted: Wed Mar 21, 2007 10:32 am
by gbusson
i used it with 7.0, and it is poor!

my solution : difference between the daysfom the constant and the 2 columns

Posted: Wed Mar 21, 2007 10:33 am
by gbusson
This function is poor, not the transformer! Well used, it is a very powerful stage!

Posted: Wed Mar 21, 2007 10:34 am
by DSguru2B
O ok. For some reason I thought the transformer was under attack, yet again.

Posted: Wed Mar 21, 2007 10:36 am
by gbusson
In France, IBM/Ascential consultants attack in their best practice,

but experience shows that it is not justified.

Posted: Wed Mar 21, 2007 10:39 am
by DSguru2B
Thats the very reason I wanted to give my 2 cents on transformer. But it all sprung from a misunderstanding.
Cheers.

Posted: Wed Mar 21, 2007 10:48 am
by gbusson
It is not useless, it was a useful chat!

See you!