Date From and Date To in Sequence

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Date From and Date To in Sequence

Post 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
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post 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.
Choose a job you love, and you will never have to work a day in your life. - Confucius
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vamsi_4a6
Participant
Posts: 95
Joined: Wed Jun 04, 2014 12:06 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Note that vamsi_4a6's syntax is specific for Oracle.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply