Convert Date to Internal Format

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rcil
Charter Member
Charter Member
Posts: 70
Joined: Sat Jun 05, 2004 1:37 am

Convert Date to Internal Format

Post by rcil »

Is there a way to convert the input date into internal format without knowing the format it is in?

Input Date can be in below formats:
14977 ----internal format
2009-01-01
2009/01/01
01/01/2009

Irrespective of the input format my output should be 14977 (in the internal format)

Is this possible with OConv(IConv,xxxxx),xxxxxx) ?

Any help is much appreciated.
Thanks,
RCil
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

See if this article helps. You need to get the component order correct and it can do the rest.

ps. Just use IConv - for internal format no OConv is needed since it does 'output' or 'external' format conversions.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes it's possible but you'll need to:
  • (a) use an If..Then..Else to determine whether the year is first or last (use Matches operator)

    (b) use a business rule to resolve ambiguity about whether 01/02 is January 2nd or 1st February (for example)
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