Date Arithmetic

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
rggoud
Participant
Posts: 15
Joined: Thu Nov 06, 2003 9:59 am

Date Arithmetic

Post by rggoud »

Hi,

How to do Date Arithmetic in Parallel ? Say Incrementing Input Date Fields by 1. When i tried to use DateFromDaysSince i got the following compiler error...

##E TFCP 000007 11:48:30(001) <transform> Error when checking composite operator: Parsing parameters "" for conversion "date=date_from_days_since[**********](int32)": APT_Conversion_Date_DaysSince: Invalid Date [] used for date_from_days_since type conversion
##E TFCP 000007 11:48:30(002) <transform> Error when checking composite operator: Parsing parameters "" for conversion "date=date_from_days_since[**********](int32)": APT_Conversion_Date_DaysSince: Invalid Date [] used for date_from_days_since type conversion
##E TFSR 000019 11:48:30(003) <main_program> Could not check all operators because of previous error(s) (TestRead.Transformer_192)


Transformer Code...

If RunningDt = StringToDate("01/01/1900","%mm/%dd/%yyyy") then DateFromDaysSince(1,StringToDate("01/01/1900","%mm/%dd/%yyyy") ) else
DateFromDaysSince(2, StringToDate("01/01/1900","%mm/%dd/%yyyy"))


Thanks in advance.

Raj.
dxp
Charter Member
Charter Member
Posts: 48
Joined: Sat Oct 01, 2005 10:23 am

Re: Date Arithmetic

Post by dxp »

rggoud wrote:Hi,

How to do Date Arithmetic in Parallel ? Say Incrementing Input Date Fields by 1. When i tried to use DateFromDaysSince i got the following compiler error...

Raj.

GOT ANSWER FOR UR PROBLEM.?? ..IF NOT JUST MAIL ME. I HAVE THE ANSWER FOR THIS QUESTION.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

dxp,

why don't you post the answer so that others are helped?

It looks like the first DateFromDaysSince() function has an invalid first argument, '1' is not a date.
dxp
Charter Member
Charter Member
Posts: 48
Joined: Sat Oct 01, 2005 10:23 am

date arithmetic

Post by dxp »

ArndW wrote:dxp,

why don't you post the answer so that others are helped?

It looks like the first DateFromDaysSince() function has an invalid first argument, '1' is not a date.
hi ArndW,

my machine was giving some problems, so late reply...

initial value of testdate1=2005-06-01

testdate2:int32=days_since_from_date["2005-05-01"](testdate1)------->(in Modify Stage...Specification property)

testdate3=testdate2+1-------->(in Transformer Stage)

testdate4:date=date_from_days_since["2005-05-01"](testdate3)------->(in Modification Stage........Specification Property)

testdate4=2005-06-02-------------->(final output....date increased by 1-day)


Note:-in place of quoted date..."2005-05-01"...any value of this format can be given. it works. output wont be wrong.


...dxp.
als110
Participant
Posts: 43
Joined: Fri Nov 05, 2004 11:21 am
Location: United States

Post by als110 »

I would just convert the date to a julian day and add 1 then convert it back
Post Reply