Can any body resolve this ?

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
balu124
Participant
Posts: 49
Joined: Wed Jul 25, 2007 9:53 pm

Can any body resolve this ?

Post by balu124 »

Hi

My source table has one column date in the format of ddmmyyyy,I need the target table with three columns as dd ,mm,yyyy separately.
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

Give a more descriptive subject next time. Use substring function in transformer in the field derivation like Inputfield[1,2], Inputfield[3,2], Inputfield[5,4].
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Look at the date conversion functions either in the Modify stage chapter or for the Transformer stage in Appendix A in the Parallel Job Developer's Guide - there are functions for extracting date components.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

Post by rumu »

Use substring function in stage variable/field level derivation for the 3 out put fileds.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

Maveric, there is no such function as InputField in Datastage 7.5.1A.
Rumu, there is no such function as substring in Datastage 7.5.1A.
Ray, from what I see in the transformer's date functions, none of them will do what he is trying to do.

It seems like this is his best option:

Left(IncomingCol,2): ' ,' : Right(Left(IncomingCol,4),2) : ',' : Right(IncomingCol,4)

Let me know what you guys think.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? InputField isn't a function but a generic field name used in the example. And the square brackets *are* the substring operators in both PX and Server jobs.

You couldn't find the 'date component' functions Ray mentioned? He meant Appendix B, at least that holds the Functions in my 7.5.1A version:

MonthDayFromDate
MonthFromDate
YearFromDate

Etc.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply