file creation

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
dsuk
Participant
Posts: 9
Joined: Thu Oct 23, 2008 12:49 am

file creation

Post by dsuk »

Hi,

there is one job which is running frequently and generating file in target. my requirement is how to suffix timestamp with the file name.

Example:
file_name_2008_11_24_12_49_14

that means filename_yyyy_mm_dd_hh_mn_ss format.


thanks in advance
hamzaqk
Participant
Posts: 249
Joined: Tue Apr 17, 2007 5:50 am
Location: islamabad

Post by hamzaqk »

Teradata Certified Master V2R5
John Smith
Charter Member
Charter Member
Posts: 193
Joined: Tue Sep 05, 2006 8:01 pm
Location: Australia

Post by John Smith »

You just need to pass in the timestamp as a Job parameter and reference that in your file stage.
dsuk
Participant
Posts: 9
Joined: Thu Oct 23, 2008 12:49 am

Post by dsuk »

need to suffix timestamp in the file name as the job finish timestamp.
dsuk
Participant
Posts: 9
Joined: Thu Oct 23, 2008 12:49 am

Post by dsuk »

Need to suffix timestamp in the file name as the job finish timestamp.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then you'll need to do it "after job". Write to a static name and add the timestamp after the job finishes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsuk
Participant
Posts: 9
Joined: Thu Oct 23, 2008 12:49 am

Post by dsuk »

my problem is to name the file as per the finish timestamp of the job.

lets say job finished at 11/26/2008 3:34:11 PM. so my file name should be like filename_11_26_2008_3_34_11_PM. the timestamp is dynamic so we can't pass the timestamp as the parametere in the job properties.

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

Post by chulett »

Understood. Suggestion was to use the current time, not a Job Parameter. A script called "after job" could easily do this.
-craig

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