Date 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
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Date Format

Post by naren6876 »

Hi,

I need a date format like : YYYYMMDD,.

But when iam writing Oconv(@DATE,"DYMD[4,2,2]") IT GIVES THE OUTPUT LIKE YYYY/MM/DD.

How do i get the result in YYYYMMDD format.

Any help would be appreciate

Naren
srikie
Participant
Posts: 58
Joined: Thu Oct 14, 2004 4:19 pm

Re: Date Format

Post by srikie »

I am not sure abt oconv() but one suggestion is extract 'yyyy','mm','dd' and concatenate. I am sure there is much a better way to do this but this was just a quick thought.
srikie
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Naren,

I posted the exact same question earlier today, see the thread at viewtopic.php?t=91533

I posted one answer, but hopefully there will be others.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I prefer

Code: Select all

Oconv(@DATE, "DYMD[4,2,2]" : @VM : "MCN")
The first piece is the date conversion, while an "MCN" conversion keeps only the numeric characters.
Read the on-line help about "MC" conversions in Oconv.
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