Hi,
I am new to batch jobs. I have a requirement such as I cannot develop a server job and I have 8 sequence jobs which are mentioned in a txt file.Now it may be possible that I may have to run all the sequences or I may have to run few. If I need not runn all the sequences, I comment them.
Could anyone suggest me how I should handle the txt file in a batch job, so that it runs only those sequences which are needed.
The parameters needed for the sequence jobs are defined in the corresponding sequence jobs.
Batch job calling the sequences mentioned in a file.
Moderators: chulett, rschirm, roy
Re: Batch job calling the sequences mentioned in a file.
Why not? Company regulations? Did you ever realize that a Sequence is basically (using DataStage-Basic) just a server-job in disguise?jeet_81 wrote:I have a requirement such as I cannot develop a server job
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon
You need to figure out how to run a job in BASIC because a batch job is all BASIC. If you look under the job properties on a sequence then you can see the code used to run a job. Sequences generate BASIC code. So you can learn how they did it.
When you are in a batch job there is a drop down for adding a job. This will also generate the code to run a job. You will need to change this hardcoded job name into a variable.
You need to get your list of jobs into the batch job. Load them one at a time into this variable and run them.
Change the stops to something graceful.
When you are in a batch job there is a drop down for adding a job. This will also generate the code to run a job. You will need to change this hardcoded job name into a variable.
You need to get your list of jobs into the batch job. Load them one at a time into this variable and run them.
Code: Select all
DataDirWhereJobListStored = '/usr//data'
openpath DataDirWhereJobListStored to DataDirFilePointer else stop
JobListFileName = 'JobList.txt'
read JobListRec from DataDirFilePointer, JobListFileName else stop
NoLines=dcount(JobListRec, @FM)
for i=1 to NoLines
JobName = trim(JobListRec<i>)
if JobName[1,1] <> '#' then
run job here
end
next i
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can create batch jobs in the Director client. This batch executes one job after another.
Anything more complex than that you would need to create a sequence job.
Anything more complex than that you would need to create a sequence job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.