running a series of scripts (ddl/dml) from job sequencer

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

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

Post by chulett »

To continue my example:

Code: Select all

Call DSExecute("UNIX",CmdString,SystemOutput,ReturnCode)
CmdString is the command to execute, SystemOutput is a variable that will capture any screen output, anything echoed from the command and ReturnCode is the variable which holds the exit code passed back by the command. Note that you can call those three local variables anything you like, these are just examples.

Check the ReturnCode for zero to see if the command executed without error. Write the contents of ScreenOutput to the job's log using DSLogInfo if that would help.

:!: Case is critical! SystemOutput and Systemoutput are two different variables.

Yes, you can do it all in one job.

Yes, that can mean the job will not have any active stages on the canvas. I would suggest you at least put an annotation on the canvas telling people what you are doing in the job and where you are doing it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kishoreramachandran
Participant
Posts: 88
Joined: Tue Nov 28, 2006 9:33 pm

Post by kishoreramachandran »

if the script i am executing is 1.sh then after the dsexecute statment I have to give
dsloginfo(systemOutput,1.sh)
.then I have to give the next dsexecute to run the next script .
if some scripts are not dependent on each other then can I create separate server job and do the same thing so that they can be run at the same time.am i correct .
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You don't have to give, but you could give:

Code: Select all

Call DSLogInfo(SystemOutput,"1.sh")
The second argument is the Calling Program Name and should be a literal, so put quotes around it. Check the online Help.

:!: When you do this 'for real' be much more careful with your spelling, or at least more so that you've done in these posts. It would be SystemOutput not systemOutput - actually use either spelling as long as it matches across all statements where you use the variable.
if some scripts are not dependent on each other then can I create separate server job and do the same thing so that they can be run at the same time.am i correct .

Yes, of course.
-craig

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