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 problem in the date extraction from source file.

Source File Format : File Name-21082008.xls

From this source file I need to extract 'Last day of the month' and populated into the Target column.

How to implement this.

Regards,
Arshi
Cr.Cezon
Participant
Posts: 101
Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid

Post by Cr.Cezon »

with a routine
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Post by arshi »

is there any other way?
Cr.Cezon
Participant
Posts: 101
Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid

Post by Cr.Cezon »

you have transforms like MONTH.LAST already created by DS
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

MONTH.LAST(Iconv(DIGITS(#FileName#),"DDMY"))
Last edited by ray.wurlod on Fri May 23, 2008 6:02 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Post by arshi »

Hi,

File Format: File Name-ddmmyyyy.csv

From this file how do I pass #FileName# in the below code

Code:
MONTH.LAST(Iconv(DIGITS(#FileName#),"DDMY")) .

Regards,
Arshi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Without the "#" characters. Use the expression editor to build the expression, particularly to add the job parameter name, to see what I mean.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Post by arshi »

Hi Ray,

Can you please explain it.I am unable to understand.

Regards,
ARSHI
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The file name is a job parameter. Build an expression that applies the DIGITS transform to this job parameter. Use the expression editor to construct the expression, so that correct syntax is guaranteed.
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