Solved

How do I create a CL to do a mass-compile of source programs?

Posted on 2008-06-25
5
888 Views
Last Modified: 2012-06-21
Hi,
I am looking at streamlining all or part of a process which involves doing many recompiles of source programs each year.  These source programs are contained in a common library.  The basic gist of the CL would be to submit a source program compile for all the members of a library, one by one, (or all at once) until it has compiled the last member in the library.  This, I think, would save time over compiling each member individually.  Any idea how to structure such a CL?  Currenly we are using the PDM environment, using option 14 which submits the command CRTBNDRPG for create bound RPG program.  I would like to have a skeleton CL that would submit each source member in the library.  
Thank you
0
Comment
Question by:wendelina
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 100 total points
ID: 21871069
wendelina:

First thing I'd do is look at ways to avoid it in the first place. This might involve a "phased in" process where a few programs at a time have their source copied to a new source file (and deleted from old), changes are made to eliminate the need for recompiles, and those programs are recompiled once. All programs left over would still go through the periodic-recompile process. Depending on why recompiles need to be done, the ways to implement this would vary.

Then, I'd review the information that can be gathered that might guide an automated process.

For example, if this involved "all bound programs in library X", I might use the List ILE Program Information (QBNLPGMI) API to list all *PGM (and List Service Program Information (QBNLSPGM) API for *SRVPGM?) objects. Note that format PGML0100 contains info on each module including the source library/file/member. Because 'compile' for ILE means 'compile modules', each entry in that list would be subject to compilation.

However, if you're thinking about OPM programs, then you might use the QUSLOBJ API to list the *PGM objects and call the Retrieve Program Information (QCLRPGMI) API with format PGMI0100 to extract source library/file/member info for the compiles.

Well, perhaps the above is a little beyond what you were thinking...

If so, then perhaps a CL program could have a library name as an incoming parm. It would issue a DSPOBJD &parmlib/*ALL objtype(*PGM) detail(*SERVICE) output(*OUTFILE) outfile(QTEMP/RECOMPPGM) command. It would then do a RCVF loop over that file and compile each program that had source info in its record. If no source info was supplied, you'd need to use one of the ILE APIs above for that object to locate the source -- unless you somehow knew where the related source was and you could use CRTBNDRPG directly.

In short, it depends on a few things.

1. Is there a single source file in a single library?
2. Are all programs the same language and environment (OPM or ILE)?
3. Are all programs to be created in the same library?

It really isn't particularly complex for any part of the process in CL. It's more that there are a variety of possible components. And, you'll be better off in the long run if you start with the components and program structure that will make things easier in the future. E.g., using CRTBNDRPG for every program pretty well stops you from easily going to any multi-module programs.

Any elaboration you can add?

Tom
0
 
LVL 27

Expert Comment

by:tliotta
ID: 21871083
BTW, your question _implies_ that all programs are single-module ILE RPG and that source member, module and program names are all the same. If that's _not_ true, please let us know.

Tom
0
 
LVL 13

Accepted Solution

by:
_b_h earned 300 total points
ID: 21871823
A couple of suggestions:

1) Using PDM, put in 14 in front of the first member, then press F13 to put the same option in front of all subsequent members. This can be customized using a user-defined PDM option.

2) Try the following program; it needs testing/tweaking but should get you started:

PGM (&SRCLIB     /* LIBRARY           NAME, *LIBL, *CURLIB...      */ +    
     &SRCF       /* SOURCE FILE(S)    NAME, GENERIC*, *ALL         */ +    
     )                                                                      
/**/                                                                        
DCL &SRCLIB     *CHAR     10                                                
DCL &SRCF       *CHAR     10                                                
/**/                                                                        
DCLF QAFDMBRL                                                              
/**/                                                                        
             DSPFD      FILE(&SRCLIB/&SRCF) TYPE(*MBRLIST) +                
                          OUTPUT(*OUTFILE) OUTFILE(QTEMP/QAFDMBRL)          
             OVRDBF     FILE(QAFDMBRL) TOFILE(QTEMP/QAFDMBRL)              
NEXTMBR:                                                                    
             RCVF                                                          
             MONMSG ( CPF0864 ) EXEC(DO)                                    
                GOTO ENDOFFILE                                              
                ENDDO                                                      
             SBMJOB     CMD(CRTBNDRPG PGM(&MLLIB/&MLNAME) +                
                          SRCFILE(&MLLIB/&MLFILE) SRCMBR(*PGM)) +          
                          JOB(&MLNAME)        
             GOTO NEXTMBR                      
ENDOFFILE:                                    
             DLTOVR QAFDMBRL                  
ENDPGM:                                        
             ENDPGM                            

Post back any questions!
Barry
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 21873037
Hi wendelina,

Go for Barry's first remark "Using PDM, put in 14"
special parameters you can add to the commandline as
REPLACE(*YES)  USRPRF(*OWNER)  or whatever you like
This will be used for every compiled source.

Regards,
Murph
0
 

Author Comment

by:wendelina
ID: 21899109
I agree with the 14 option.  I was overthinking the "bang" that we could get out of mass-compiling.  It will take less time to simply take that option.  
TLiotta: thank you that is way more than I understand about RPG programs - I appreciate immensely the thought you put into that one.
Regards and many thanks,
Wendy
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How many times a day do you open, acknowledge, or close an IT incident? What’s your process? Do you have a process depending on the incident, systems involved, and other factors? New Relic Alerts gives you options for how you interact with notifica…
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question