If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

CALLB: Creating a bound program.

I have one RPGLE program and one CLLE program. Inside RPGLE program a CallB is issued for CLLE program.

How do I compile a program that will have two modules for above programs and will execute them, without needing the *MODULE objects of above programs. (I just need one program no *modules)

I know this can be done, but don't know how. This is the first time I work with ILE code, any help is appreciated.

In past I have done some coding with CallP and for that I used to make modules and call them up by declaring them in program using CRTPGM. But this way required *Module objects to be present in order to execute.

Many Thanks

*...1....+....2....+....3....+....4....+....5....+ ....6....+....7.......+....8.......+....9.......+. ...10.......+....11...
C*There are only 10 type of people in this world, those who understand binary and those who don't.

Comment

How do I compile a program that will have two modules for above programs and will execute them, without needing the *MODULE objects of above programs. (I just need one program no *modules) In past I have done some coding with CallP and for that I used to make modules and call them up by declaring them in program using CRTPGM. But this way required *Module objects to be present in order to execute.

I'm curious, though, why do you care whether or not you have modules? Is it the actual creation of the modules you are trying to avoid? Or do you just dislike having them around after the program is created?

"Time passes, but sometimes it beats the <crap> out of you as it goes."

Comment

I'm curious, though, why do you care whether or not you have modules? Is it the actual creation of the modules you are trying to avoid? Or do you just dislike having them around after the program is created?

That's how program existed in Prod and I had to replicate that. I already did it the way you explained and was getting a "reference pointer error'. But I repeated the steps, recompiled everything and it worked.

Did a bit of reading and seems like what I wanted to achieve is called static binding of modules and what I wanted to avoid is dynamic binding.
I have no grudge against Modules

I guess this also answers Mercury's question. It's not what what I should be doing, but it's just the requirements. If it was up to me, I would change the whole program .

Hey but I wouldn't mind you telling me why CallP is secure and better!

Thanks for all your help.

*...1....+....2....+....3....+....4....+....5....+ ....6....+....7.......+....8.......+....9.......+. ...10.......+....11...
C*There are only 10 type of people in this world, those who understand binary and those who don't.

Comment

Hey but I wouldn't mind you telling me why CallP is secure and better!

Originally posted by me from "Who Knew You Could Do That with RPG IV?
A Sorcerer’s Guide to System Access and More"

The prototyped calls (CALLP or a function call) are just as efficient as CALL and CALLB and offer the advantages of prototyping and parameter passing by value. Neither CALL nor CALLB can accept a return value from a procedure.
The prototyped call provides a much better interface and offers the benefits of parameter checking and a number of other advantages. Prototypes can do much more for you than simply defining the parameters to subprocedures. By using some of the optional keywords for prototypes, you can have the compiler check the number and type of parameters in your calling program and procedures. It can even accommodate small types of mismatches, such as passing an integer when the callee expects a value with decimal places.

Comment

Thanks for taking time and sharing information. I will surely give this redbook a read.

*...1....+....2....+....3....+....4....+....5....+ ....6....+....7.......+....8.......+....9.......+. ...10.......+....11...
C*There are only 10 type of people in this world, those who understand binary and those who don't.