How to convert DATE in internal format for comparison

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
ashcar
Charter Member
Charter Member
Posts: 28
Joined: Mon Feb 09, 2004 11:54 am
Location: Minneapolis

How to convert DATE in internal format for comparison

Post by ashcar »

In server job we use Iconv and Oconv to do conversion of date and then compare between the internal values..
how can ido the same in parallel extender...
tried using DatetoString but does not work for me

please help
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Without using a stage type that supports BASIC expressions (such as the "BASIC Transformer" stage), the parallel extender does not support the concept of an internal format for dates.

You could, of course, create a buildop that uses substringing techniques to decompose the dates into "days since a certain day zero" and (perhaps a separate buildop) to compare them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mpouet
Participant
Posts: 34
Joined: Mon Oct 18, 2004 10:23 am
Location: France

Re: How to convert DATE in internal format for comparison

Post by mpouet »

Hi,

Try "JulianDayFromDate", it is a kind of internal date.

Good luck
Matthieu
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

Hi

Yes in PX you need to use normal transformer. use JulianDayFromDate () it will work.

Thanks
Man
rameshDHL
Premium Member
Premium Member
Posts: 21
Joined: Mon Nov 15, 2004 3:57 am

Re: How to convert DATE in internal format for comparison

Post by rameshDHL »

ashcar wrote:In server job we use Iconv and Oconv to do conversion of date and then compare between the internal values..
how can ido the same in parallel extender...
tried using DatetoString but does not work for me

please help

We can still use Iconv and Oconv in parallel extender by using shared container. It will incorporate the functionalities into parallel extender. Other functions available are JulianDayfromDate DateFromJulianDay.
bchau
Charter Member
Charter Member
Posts: 46
Joined: Tue Jan 18, 2005 7:39 am
Location: Japan
Contact:

Post by bchau »

Hi I was wondering if there would be an error if I enter Feb 31 as the argument for JulianDayFromDate function. Or does it automatically convert it to Feb 28/29?
Post Reply