How to execute more commands in the Before/After Job routine

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
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

How to execute more commands in the Before/After Job routine

Post by Shree0410 »

Hi all,

If I want to execute multiple commands on the Before or the After job routines, for example if I want to execute 2 commands in the before job routine like 'delete a file from a directory' and also cat 2 or 3 files to make a single file, how can I do this.

thanks guyz
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Build a small script for that and fire that script from the before/after job subroutine section using ExecSh
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Post by Shree0410 »

Thanks a lot, but I am not allowed to write my own scripts without the prior approval, so i am trying to find a way to execute multiple commands from the job parameters.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then put a semi-colon between the commands.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Learn about operating system pipelining. In summary:

Code: Select all

command1 ; command2
command2 is executed unconditionally after command1 finishes

Code: Select all

command1 && command2
command2 is executed only if command1 finishes successfully (with an exit status of 0)

Code: Select all

command1 !! command2
command2 is executed only if command1 finishes unsuccessfully (with an exit status of other than 0)
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