Sadam Husain
Sadam Husain

Reputation: 41

Submitting a RPGLE job multiple times

I have created a RPGLE program that processes a huge file. I am submitting the program as a batch job and it takes significant amount of time to process all the records. So, I am planning to submit the job multiple times. Is it ok to do that ?.

If it is ok, could you suggest how to implement it ?

Note: I am using SQL not native I/O files.

Upvotes: 0

Views: 740

Answers (2)

jmarkmurphy
jmarkmurphy

Reputation: 11493

It really depends on what kind of processing you are doing. If you are just reading through the file, a correct index should make your processing quite fast. It could be the output that is causing you issues. If you are writing a lot of data to a file, then you could temporarily drop indexes on that file, and rebuild them after you are finished. This is frequently much faster than updating the indexes one record at a time, and may even make set based updates faster. Another option could to end journaling if you don't need commitment control, then restart when the processing finishes. Note both of these are really only applicable to data load processes.

Upvotes: 0

Charles
Charles

Reputation: 23823

Depends on the program, but generally submitting multiple copies is a valid solution.

However, it generally does not work without changes to the original program.

If the program used RPG native record-level-access (RLA), it's usually a matter of passing in parms that tell the program where to start & stop. So for instance you can submit 4 copies and each does 25% of the work.

Similar tactic might work for a program using SQL. However, I suspect your program using doing RLA with SQL instead of processing sets. Rewriting the program to use SQL set based processing may be a better choice.

Nice thing about set based SQL, is that the system will automatically work in parallel, with the Db2 SMP option installed if applicable.

Upvotes: 2

Related Questions