date conversion issue

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
aladap12
Participant
Posts: 60
Joined: Fri Jul 20, 2007 1:15 pm
Location: NO

date conversion issue

Post by aladap12 »

All

I had an issue with date conversion

My source file has date formet 'mmddyy' and i need to send to target in other formet lilke mmdd18yy

means everytime i have to add 18 to source data and send the data

Is there any function in ds do this for me or should need to write any routine for this.

please suggest me on this issue.

Thanks
svipul16
Participant
Posts: 8
Joined: Sun Sep 23, 2007 10:29 am

Re: date conversion issue

Post by svipul16 »

In Transformer do derivation as

Left(cloumn_name,4):18:right(cloumn_name,2)





I had an issue with date conversion

My source file has date formet 'mmddyy' and i need to send to target in other formet lilke mmdd18yy

means everytime i have to add 18 to source data and send the data

Is there any function in ds do this for me or should need to write any routine for this.

please suggest me on this issue.

Thanks[/quote]
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Since you are doing a string Manupulation, add qoute around 18 from the given solution.
Left(cloumn_name,4):'18':right(cloumn_name,2)
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
aladap12
Participant
Posts: 60
Joined: Fri Jul 20, 2007 1:15 pm
Location: NO

Thanks Man

Post by aladap12 »

kumar_s wrote:Since you are doing a string Manupulation, add qoute around 18 from the given solution.
Left(cloumn_name,4):'18':right(cloumn_name,2) ...
Thanks a lot

can we have any routine to do this, b'cos i have to use this in diffrent jobs

Thanks
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Do you mean to say, you need to perform this task in various other jobs as well. Include the same statment in other jobs as well. Ofcouse you can write a routine, but its not that effective or this single liner.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Do you mean to say, you need to perform this task in various other jobs as well. Include the same statment in other jobs as well. Ofcouse you can write a routine, but its not that effective or this single liner.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Store the one-liner as a Transform rather than as a Routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

One point of clarification: are you intending to prepend 18 to any two digit year? OR do you need to add either 18 days or 18 years to the existing date? If you are prepending 18 to the YY supplied, you are stating you want all of the year portions of a date to be in the 19th century.

Guess I'm just curious as to why?? :?
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
Post Reply