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

kishoreramachandran
Participant
Posts: 88
Joined: Tue Nov 28, 2006 9:33 pm

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

Post by kishoreramachandran »

A series of scripts (ddl/dml) need to be run through the job sequencer.
the 1st script will be run with 5 different input values and then the 2nd script with the different set of input values and so on. What will be the best design for this.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What value is the ETL tool adding to this? Why not just script 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 »

they want everthing to be controlled through datatage
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They need a good... well, nevermind what they need.

Create a standard routine that executes shell scripts. Then a Sequence job with a series of Routine Activity stages can run them. Or code a series of DSExecute calls into the Job Control tab of a Server job and run that.

Or push back and tell 'them' that just because you've got a shiny new DataStage hammer, not every problem is suddenly a nail. :P
-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 »

If they insist upon DataStage for control, why do they insist upon shell scripts? Why not have DataStage do the whole thing? After all, they've paid the money!

It is sometimes necessary to push back, particularly when what "they" want can not be intelligently justified. Please be advised by a couple of very experienced DataStage practitioners.

As to your original questions, what's wrong with sufficient Execute Command activities in the job sequence? The values can be passed to the shell scripts either as command line arguments (retrieved from $1, $2 and so on) or as environment variable values.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kishoreramachandran
Participant
Posts: 88
Joined: Tue Nov 28, 2006 9:33 pm

Post by kishoreramachandran »

basically what they plan is to cut and paste the same script with may be some minor changes and execute within datastage
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

They spent such a huge sum on a graphical tool so that they could paste scripts into it?!! Please advise names of persons who make decisions and persons who sign checks. Urgent requirement!!! :lol:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Make your script clever enough to handle your minor changes and pass them as parameters.
or change the contents of the script everytime you run this script(Not a good practice but an option :wink: )
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
kishoreramachandran
Participant
Posts: 88
Joined: Tue Nov 28, 2006 9:33 pm

Post by kishoreramachandran »

none of the replies have helped me so far
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This
ray.wurlod wrote:As to your original questions, what's wrong with sufficient Execute Command activities in the job sequence? The values can be passed to the shell scripts either as command line arguments (retrieved from $1, $2 and so on) or as environment variable values.
is a solution.

If you have chosen not to implement it, then of course it hasn't helped you!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

These
chulett wrote:Create a standard routine that executes shell scripts. Then a Sequence job with a series of Routine Activity stages can run them. Or code a series of DSExecute calls into the Job Control tab of a Server job and run that.
also were solutions offered to you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

kishoreramachandran wrote:none of the replies have helped me so far
The solutions given to you, are some of the best available ways you can implement your requirement using datastage.
Have you tried to implement them?
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
kishoreramachandran
Participant
Posts: 88
Joined: Tue Nov 28, 2006 9:33 pm

Post by kishoreramachandran »

if i use dsexecute to execute a shell script name 1.sh how do i give the parameters. can you help with the actual command.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You build a complete 'command string', parameters and all, and pass that to DSExecute for it to run. We can't just 'give you the command' as each would be different. Use the concatenation operator - the colon (:) - and put together all the same parts you would put on the command line if you ran the script by hand.

For example, let's say you wanted to run script '/user/fred/scripts/get_gone' and you needed to pass it the current date. From the command line you might type:

Code: Select all

/user/fred/scripts/get_gone 2006-12-09
For DSExecute you would build the same string, but use a variable or job parameter for the current date:

Code: Select all

CmdString = "/user/fred/scripts/get_gone ":DateParameterName
Then you would use the resulting CmdString in your DSExecute call.
-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 »

when I am running in unix the will the command be

dsexecute("uv",cmd,output,0) what should i give for output, and if I have to code so many dsexecutes can I do it in 1 server job.

does it mean that the job will not have any stages .
Post Reply