Page 1 of 1

Date From and Date To in Sequence

Posted: Thu Jul 21, 2016 4:22 am
by prasson_ibm
Hi All,

I am stuck in requirement where I need to pass DATE_FROM and DATE_TO in sequence job activities where DATE_FROM is first day of previous moth and DATE_TO is last day of previous month if I am running my sequence in current month.

Can anyone help me with the date derivation logic.


Regards
Prasoon

Posted: Thu Jul 21, 2016 7:14 am
by qt_ky
If you want to use User Variable stage and DataStage BASIC, then I would guess you have to create a routine and call it.

Or, you could do something like what is mentioned by ArndW in this topic.

Posted: Thu Jul 21, 2016 4:01 pm
by ray.wurlod
I'd also recommend User Variables.

Examine the Transforms in your Repository, particularly MONTH.FIRST and MONTH.LAST to get ideas about how to calculate these dates.

Posted: Fri Jul 22, 2016 7:07 am
by vamsi_4a6
Use your database and write the output to a file.

select trunc(sysdate,'MONTH')-1 as lastdayofpreviousmonth,trunc(trunc(sysdate,'MONTH')-1,'MONTH') as firstdayofpreviousmonth from dual

Posted: Fri Jul 22, 2016 2:40 pm
by ray.wurlod
Note that vamsi_4a6's syntax is specific for Oracle.