Date Extraction

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
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Date Extraction

Post by arshi »

Hi,

I am facing following problem.

I have 4 target columns like Ext_Date,Day,Month,Year.
In the Ext_Date column I need to populate the Date format(DD-MMM-YYYY) by using system date minus oneday.
For this I taken ,Oconv(Iconv(DATE.TAG(@DATE - 1),"D-YMD[4,2,2]") ,"D-DMY[2,A3,4]").

From this how to extract DAY,MONTH,YEAR data.

For example ,from the above code I got the Ext_Date as : 14-JUL-2008.I want output as 14 for DAY,07 for MONTH,2008 FOR YEAR columns.

Database : Oracle

Any one have the solution send it to me.

Regards,
Arshi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you want "07" for the month, don't use "A3" in the OConv date mask. Once you have the date you can use Field to split the pieces out, or just substring them.
-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 »

Investigate the database-specific date conversions available in the SDK.
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