Is there a way to compile a huge amount of cobol programs at once instead of one by one?

Edgar Castro
Edgar Castro used Ask the Experts™
Necesito compilar masivamente programas cobol de mi as400 versión 7.1  a versión 6.1. Existe alguna forma de compilar en forma masiva y no uno por uno?

I need to compile a lot of cobol programs from my as400 version 7.1 to version 6.1. Is there a way to compile a huge amount of cobol programs at once instead of one by one?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Can you create a script that will for a fork() and exec() operations for each program you need to build?
Gary PattersonVP Technology / Senior Consultant
Do you have PDM?
What is the source type on your COBOL source members (CBL, CBLLE, CBL36, CBL38, SQLCBL, SQLCBLLE)?

STRPDM, Option 2
Enter the COBOL source code library and source file (QLBLSRC, or QCBLLESRC usually).
Select option 14 on the first source member
Press F13 to copy option 14 to all members on the list
Press Enter

For more complex compiles, you may want to create a CL:
Easiest might simply be to submit compiles to batch through a multi-threaded *JOBQ such as QUSRNOMAX.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Gary PattersonVP Technology / Senior Consultant
Tom makes a good point: submitting to a job queue that is configured to allow multiple jobs at a time will be faster than compiling one at a time.  But if you have a lot of compiles, I don' think submitting them all to QUSRNOMAX (at least in its default state) is a good idea.

By default QUSRNOMAX jobq is attached to QUSRWRK subsystem, which by default uses *BASE memory pool.  Both the subsystem and the job queue are configured to allow an unlimited number of jobs to start (*NOMAX).  Submitting hundreds or thousands of jobs simultaneously to QUSRNOMAX is liable to swamp system with compiles.  I'd submit to a queue with a MAXACT initially no wider than 1-2x the number of processors in the system if performance of other work in the system matters, and bump it up experimentally as you observe impact on system performance and compile times.

Even more caution is needed in "single system/single LPAR" shops where the same system is used for development, testing, and production.
And Gary also makes a good point. I don't know if I've seen more than, say, one out of ten systems that had proper subsystem configurations. Nowadays, newer systems don't run into as much resource contention in almost any "normal" operation such that it's a big concern. But exceptions do exist; and without seeing a representative sample of workloads and schedules, it's mostly guesswork.

The question asked if compiles could all be done concurrently ("at once"), and the answer is "Yes." Whether that's a good idea using a default work management configuration is a different question that is answered starting with "It depends...".

A full answer probably should begin with something like "Let's review your system's work management configuration and your system's workloads and schedules. After ensuring a proper configuration, we will then look at compilation options." It's often more than a trivial task.
Gary PattersonVP Technology / Senior Consultant
@Tom:  I didn't read it quite the same.  I decided the question was probably more along the lines of "how to submit a mass compile", rather than literally "how to compile in parallel".

I'm picturing a list of source members in PDM that is hundreds of pages long, and a user faced with the prospect of going "14,14,14,14,14,14,14,14, page down" - over and over, and hoping there is a better way.

After reading your responses, however, I realize it could be PDM usage, work management, or, perhaps both:  how to submit in a single stroke, -and- manage effectively the number of simultaneous compile jobs.  So:

1) Configure a job queue to allow the desired number of simultaneous compiles.  I recommend 2x the number of processors as a starting point, and vary number up or down to govern how much system resources are used.

2) Modify PDM options to submit using a jobd referencing the job queue in step 1.

3) Modify PDM options to compile in batch.

Then follow the PDM mass compile submission steps outlined in my previous post.

Can we close this question?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial