reading date from the file name

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
ravi_etl
Participant
Posts: 9
Joined: Tue Jul 15, 2008 10:11 pm

reading date from the file name

Post by ravi_etl »

Hi,

I have a file to process that file has a filename as filename_date.csv
I need to pass that date in the job is there anyway to do this.
If so please let me know.


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

Post by chulett »

Please explain precisely what "I need to pass that date in the job" means.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsedi
Participant
Posts: 220
Joined: Wed Jun 02, 2004 12:38 am

Post by dsedi »

chulett wrote:Please explain precisely what "I need to pass that date in the job" means. ...
:)
ravi_etl wrote:Hi,

I have a file to process that file has a filename as filename_date.csv
I need to pass that date in the job is there anyway to do this.
If so please let me know.


Thanks
In Sequential file stage you have "fileNameColumn" property.
Read the help available.

Code: Select all

Adds a VarChar (Unicode for NLS installs) column to the output that contains the name of the file that the record is sourced from. User must add this column definition to the output columns to prevent it from being dropped if runtime column propagation is unchecked
from this,you can strip the value to get the date.
vrishabhsagar
Participant
Posts: 33
Joined: Mon Nov 12, 2007 1:02 am
Location: Bangalore

Re: reading date from the file name

Post by vrishabhsagar »

ravi_etl wrote:Hi,

I have a file to process that file has a filename as filename_date.csv
I need to pass that date in the job is there anyway to do this.
If so please let me know.


Thanks
Do you need to parse out the date from the filename? You want to do that using a sequence? job? or script?
Rishabh Sagar V
Bangalore
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I asked because I'm not that much into guessing what the problem or question might be anymore, and would prefer people learn how to ask for help.

:idea: Always make sure your question / issue is clear and you've attempted to provide enough information so that (ideally) people can get right to the 'solving' part and we don't end up with multiple back-and-forth exchanges for clarifications or chasing of the wild geeses.
-craig

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