I am writing a set of programs that create, write and compile a set of SQLRPGLE programs. A lot of the code at the beginning of my program is repeated in every program I have, so it makes sense for me to put this into a reference source ... it is roughly of the form
H some h specs
D a load of d specs
/free
my nice free formatted code that I use everywhere
Then my metaprogram comes along and adds lots of code. At this point my program looks like this
/copy *libl/qrpgleref,myRefPgm
lots of nice rpg and sql
/end-free
When I compile this it doesn't work - I think this is because the program can't match up the /free and /end-free properly ... is that right? Or am I missing something more subtle here?
Cheers
I think the reason your program isn't compiling, based only on the samples provided in your question, is because you have H and D specs mixed in with your free format calc specs. Order is important with RPG and you can't mess with that. If your copied code requires D and H specs, then you have two options: