Renaming file in Unix at the end of a job sequence?

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
cbres00
Participant
Posts: 34
Joined: Tue Sep 21, 2004 9:20 am

Renaming file in Unix at the end of a job sequence?

Post by cbres00 »

I create a flat file in one of my job sequences. I'd like to archive it with a date and timestamp at the end of my job sequence.

Any elegant/simple ways to do this?

TIA,
Cathy
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Use mv command and supply the target file name as mixed parameters.
ram1899
Charter Member
Charter Member
Posts: 41
Joined: Wed Aug 04, 2004 11:46 am

Re: Renaming file in Unix at the end of a job sequence?

Post by ram1899 »

Create a sh script and call it as after Job routine please check box after Job Run Sucessfully Bu doing this it will only run if the run sucessfully


cbres00 wrote:I create a flat file in one of my job sequences. I'd like to archive it with a date and timestamp at the end of my job sequence.

Any elegant/simple ways to do this?

TIA,
Cathy
ram1899
cbres00
Participant
Posts: 34
Joined: Tue Sep 21, 2004 9:20 am

Post by cbres00 »

How would I call a shell script from a job seq? This will open up a whole world of flexibility for me if I knew how to do it!

Regards and thanks,
Cathy
amsh76
Charter Member
Charter Member
Posts: 118
Joined: Wed Mar 10, 2004 10:58 pm

Post by amsh76 »

If you have to do it as after job, then its only possible if you include that in very last job of your sequence or else you can always use execute command stage in your sequencer for executing unix command.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Call a shell script from an after-stage subroutine or after-job subroutine. Specify ExecSH as the subroutine, and add the pathname of the shell script plus any command line arguments (which can be job parameter references) in the Input Value field.

Or you can write your own before/after subroutine - perhaps a clone of ExecSH but with different logging characteristics - and invoke that instead.
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