How to append a time stamp to the ouput file in FTPStage ?

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
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

How to append a time stamp to the ouput file in FTPStage ?

Post by laxmi_etl »

Hi-

How to append a timestamp to the ouput file in FTPStage ?

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

Post by ray.wurlod »

Job parameter containing the full file name?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

Post by laxmi_etl »

Yes. the file name is parameterized.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Does appending #DSJobStartTimestamp# to the outputfile not help?
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or pass in the timestamp as a job parameter and concatenate the two pieces in the FTP stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

Post by laxmi_etl »

How do I pass the timestamp in job parameter??
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not sure what else to say other than you generate it and pass it into the job as a parameter. The 'old fashioned' way would be to create a routine that gets a system timestamp and strips out all the yucky bits you don't want, typically the dashes and colons.

From '2006-11-28 20:44:13' to '20061128_204413' perhaps?

Sequencer job runs it and passes it to the FTP job. Heck, for all I know you can do this all directly in the Job Activity's parameter value nowadays, haven't tried.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nvuradi
Participant
Posts: 54
Joined: Tue Dec 12, 2006 11:03 pm

Post by nvuradi »

narasimha wrote:Does appending #DSJobStartTimestamp# to the outputfile not help?
Hi tried appending the #DSJobStartTimestamp# with the file name but the job is aborting with following error message

test_2007-08-29 05:49:57.txt is not a valid path name
:(


is der any other way to append the timestamp to file without using job parameter and after job routine?? any idea??

Thanks
Narendar :
mohdsuf
Participant
Posts: 24
Joined: Mon Jun 18, 2007 3:21 am
Location: India

Post by mohdsuf »

I have a ready shell script script which can be used to append timestamp to the file name.
Just tell me the excat format which you want your output file to be. May be that shell script helps you out and it can be called from after job subroutine.
Sufiyan
nvuradi
Participant
Posts: 54
Joined: Tue Dec 12, 2006 11:03 pm

Post by nvuradi »

mohdsuf wrote:I have a ready shell script script which can be used to append timestamp to the file name.
Just tell me the excat format which you want your output file to be. May be that shell script helps you out and it can be called from after job subroutine.
i have the script with me which i can use but i wanted to do this within a job without using job parameter and after job routine and also script.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can't be done. Go with the parameter.
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